<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-orphans #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns, MagicHash, CPP, TypeFamilies #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE TemplateHaskellQuotes #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      : Data.Text.Lazy</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   : (c) 2009, 2010, 2012 Bryan O'Sullivan</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     : BSD-style</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Maintainer  : bos@serpentine.com</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability : GHC</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- A time and space-efficient implementation of Unicode text using</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- lists of packed arrays.</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- /Note/: Read below the synopsis for important notes on the use of</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- this module.</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- The representation used by this module is suitable for high</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- performance use and for streaming large quantities of data.  It</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- provides a means to manipulate a large body of text without</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- requiring that the entire content be resident in memory.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- Some operations, such as 'concat', 'append', 'reverse' and 'cons',</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- have better time complexity than their &quot;Data.Text&quot; equivalents, due</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- to the underlying representation being a list of chunks. For other</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- operations, lazy 'Text's are usually within a few percent of strict</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- ones, but often with better heap usage if used in a streaming</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- fashion. For data larger than available memory, or if you have</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- tight memory constraints, this module will be the only option.</span><span>
</span><span id="line-32"></span><span class="hs-comment">--</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- This module is intended to be imported @qualified@, to avoid name</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- clashes with &quot;Prelude&quot; functions.  eg.</span><span>
</span><span id="line-35"></span><span class="hs-comment">--</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- &gt; import qualified Data.Text.Lazy as L</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Text.Lazy</span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Fusion</span></span><span>
</span><span id="line-41"></span><span>    </span><span class="annot"><span class="hs-comment">-- $fusion</span></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Acceptable data</span></span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><span class="hs-comment">-- $replacement</span></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Types</span></span><span>
</span><span id="line-47"></span><span>      </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier">Text</span></a></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Creation and elimination</span></span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier">pack</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier">unpack</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-identifier">singleton</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier">empty</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier">fromChunks</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier">toChunks</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toStrict"><span class="hs-identifier">toStrict</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#fromStrict"><span class="hs-identifier">fromStrict</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier">foldrChunks</span></a></span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#foldlChunks"><span class="hs-identifier">foldlChunks</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Basic interface</span></span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#cons"><span class="hs-identifier">cons</span></a></span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#snoc"><span class="hs-identifier">snoc</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#append"><span class="hs-identifier">append</span></a></span><span>
</span><span id="line-65"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#uncons"><span class="hs-identifier">uncons</span></a></span><span>
</span><span id="line-66"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unsnoc"><span class="hs-identifier">unsnoc</span></a></span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#head"><span class="hs-identifier">head</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#last"><span class="hs-identifier">last</span></a></span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#tail"><span class="hs-identifier">tail</span></a></span><span>
</span><span id="line-70"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#init"><span class="hs-identifier">init</span></a></span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#null"><span class="hs-identifier">null</span></a></span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#length"><span class="hs-identifier">length</span></a></span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#compareLength"><span class="hs-identifier">compareLength</span></a></span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Transformations</span></span><span>
</span><span id="line-76"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#map"><span class="hs-identifier">map</span></a></span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#intercalate"><span class="hs-identifier">intercalate</span></a></span><span>
</span><span id="line-78"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#intersperse"><span class="hs-identifier">intersperse</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#transpose"><span class="hs-identifier">transpose</span></a></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier">reverse</span></a></span><span>
</span><span id="line-81"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replace"><span class="hs-identifier">replace</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Case conversion</span></span><span>
</span><span id="line-84"></span><span>    </span><span class="annot"><span class="hs-comment">-- $case</span></span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toCaseFold"><span class="hs-identifier">toCaseFold</span></a></span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toLower"><span class="hs-identifier">toLower</span></a></span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toUpper"><span class="hs-identifier">toUpper</span></a></span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toTitle"><span class="hs-identifier">toTitle</span></a></span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Justification</span></span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#justifyLeft"><span class="hs-identifier">justifyLeft</span></a></span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#justifyRight"><span class="hs-identifier">justifyRight</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#center"><span class="hs-identifier">center</span></a></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Folds</span></span><span>
</span><span id="line-96"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl"><span class="hs-identifier">foldl</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl%27"><span class="hs-identifier">foldl'</span></a></span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl1"><span class="hs-identifier">foldl1</span></a></span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl1%27"><span class="hs-identifier">foldl1'</span></a></span><span>
</span><span id="line-100"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldr"><span class="hs-identifier">foldr</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldr1"><span class="hs-identifier">foldr1</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Special folds</span></span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier">concat</span></a></span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#concatMap"><span class="hs-identifier">concatMap</span></a></span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#any"><span class="hs-identifier">any</span></a></span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#all"><span class="hs-identifier">all</span></a></span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#maximum"><span class="hs-identifier">maximum</span></a></span><span>
</span><span id="line-109"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#minimum"><span class="hs-identifier">minimum</span></a></span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Construction</span></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Scans</span></span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#scanl"><span class="hs-identifier">scanl</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#scanl1"><span class="hs-identifier">scanl1</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#scanr"><span class="hs-identifier">scanr</span></a></span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#scanr1"><span class="hs-identifier">scanr1</span></a></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Accumulating maps</span></span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#mapAccumL"><span class="hs-identifier">mapAccumL</span></a></span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#mapAccumR"><span class="hs-identifier">mapAccumR</span></a></span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Generation and unfolding</span></span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#repeat"><span class="hs-identifier">repeat</span></a></span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replicate"><span class="hs-identifier">replicate</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#cycle"><span class="hs-identifier">cycle</span></a></span><span>
</span><span id="line-127"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#iterate"><span class="hs-identifier">iterate</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unfoldr"><span class="hs-identifier">unfoldr</span></a></span><span>
</span><span id="line-129"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unfoldrN"><span class="hs-identifier">unfoldrN</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Substrings</span></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Breaking strings</span></span><span>
</span><span id="line-134"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#take"><span class="hs-identifier">take</span></a></span><span>
</span><span id="line-135"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#takeEnd"><span class="hs-identifier">takeEnd</span></a></span><span>
</span><span id="line-136"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#drop"><span class="hs-identifier">drop</span></a></span><span>
</span><span id="line-137"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropEnd"><span class="hs-identifier">dropEnd</span></a></span><span>
</span><span id="line-138"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#takeWhile"><span class="hs-identifier">takeWhile</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#takeWhileEnd"><span class="hs-identifier">takeWhileEnd</span></a></span><span>
</span><span id="line-140"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-identifier">dropWhile</span></a></span><span>
</span><span id="line-141"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropWhileEnd"><span class="hs-identifier">dropWhileEnd</span></a></span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropAround"><span class="hs-identifier">dropAround</span></a></span><span>
</span><span id="line-143"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#strip"><span class="hs-identifier">strip</span></a></span><span>
</span><span id="line-144"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#stripStart"><span class="hs-identifier">stripStart</span></a></span><span>
</span><span id="line-145"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#stripEnd"><span class="hs-identifier">stripEnd</span></a></span><span>
</span><span id="line-146"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#splitAt"><span class="hs-identifier">splitAt</span></a></span><span>
</span><span id="line-147"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#span"><span class="hs-identifier">span</span></a></span><span>
</span><span id="line-148"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#breakOn"><span class="hs-identifier">breakOn</span></a></span><span>
</span><span id="line-149"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#breakOnEnd"><span class="hs-identifier">breakOnEnd</span></a></span><span>
</span><span id="line-150"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#break"><span class="hs-identifier">break</span></a></span><span>
</span><span id="line-151"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#group"><span class="hs-identifier">group</span></a></span><span>
</span><span id="line-152"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#groupBy"><span class="hs-identifier">groupBy</span></a></span><span>
</span><span id="line-153"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#inits"><span class="hs-identifier">inits</span></a></span><span>
</span><span id="line-154"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#tails"><span class="hs-identifier">tails</span></a></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Breaking into many substrings</span></span><span>
</span><span id="line-157"></span><span>    </span><span class="annot"><span class="hs-comment">-- $split</span></span><span>
</span><span id="line-158"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#splitOn"><span class="hs-identifier">splitOn</span></a></span><span>
</span><span id="line-159"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#split"><span class="hs-identifier">split</span></a></span><span>
</span><span id="line-160"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#chunksOf"><span class="hs-identifier">chunksOf</span></a></span><span>
</span><span id="line-161"></span><span>    </span><span class="hs-comment">-- , breakSubstring</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Breaking into lines and words</span></span><span>
</span><span id="line-164"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#lines"><span class="hs-identifier">lines</span></a></span><span>
</span><span id="line-165"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#words"><span class="hs-identifier">words</span></a></span><span>
</span><span id="line-166"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unlines"><span class="hs-identifier">unlines</span></a></span><span>
</span><span id="line-167"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unwords"><span class="hs-identifier">unwords</span></a></span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Predicates</span></span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span>
</span><span id="line-171"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isSuffixOf"><span class="hs-identifier">isSuffixOf</span></a></span><span>
</span><span id="line-172"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isInfixOf"><span class="hs-identifier">isInfixOf</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** View patterns</span></span><span>
</span><span id="line-175"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#stripPrefix"><span class="hs-identifier">stripPrefix</span></a></span><span>
</span><span id="line-176"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#stripSuffix"><span class="hs-identifier">stripSuffix</span></a></span><span>
</span><span id="line-177"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#commonPrefixes"><span class="hs-identifier">commonPrefixes</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Searching</span></span><span>
</span><span id="line-180"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#filter"><span class="hs-identifier">filter</span></a></span><span>
</span><span id="line-181"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#find"><span class="hs-identifier">find</span></a></span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#elem"><span class="hs-identifier">elem</span></a></span><span>
</span><span id="line-183"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#breakOnAll"><span class="hs-identifier">breakOnAll</span></a></span><span>
</span><span id="line-184"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#partition"><span class="hs-identifier">partition</span></a></span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span>    </span><span class="hs-comment">-- , findSubstring</span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Indexing</span></span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#index"><span class="hs-identifier">index</span></a></span><span>
</span><span id="line-190"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#count"><span class="hs-identifier">count</span></a></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Zipping and unzipping</span></span><span>
</span><span id="line-193"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#zip"><span class="hs-identifier">zip</span></a></span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#zipWith"><span class="hs-identifier">zipWith</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>    </span><span class="hs-comment">-- -* Ordered text</span><span>
</span><span id="line-197"></span><span>    </span><span class="hs-comment">-- , sort</span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier">Char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier">Bool</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier">Maybe</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier">String</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-201"></span><span>                </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier">Eq</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier">Ord</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier">Ordering</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier">Read</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier">Show</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-202"></span><span>                </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator">(&amp;&amp;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator">(||)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator">(+)</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#."><span class="hs-operator">(.)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator">($)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator">(++)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-203"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier">error</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier">flip</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier">fmap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier">fromIntegral</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier">not</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier">otherwise</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#quot"><span class="hs-identifier">quot</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-204"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">P</span></span><span>
</span><span id="line-205"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#"><span class="hs-identifier">Control.DeepSeq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier">NFData</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-206"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Int.html#"><span class="hs-identifier">Data.Int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier">Int64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">L</span></span><span>
</span><span id="line-208"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier">isSpace</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#"><span class="hs-identifier">Data.Data</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier">Data</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Data.html#gfoldl"><span class="hs-identifier">gfoldl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#toConstr"><span class="hs-identifier">toConstr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#gunfold"><span class="hs-identifier">gunfold</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#dataTypeOf"><span class="hs-identifier">dataTypeOf</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#constrIndex"><span class="hs-identifier">constrIndex</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-210"></span><span>                  </span><span class="annot"><a href="../../base/src/Data.Data.html#Constr"><span class="hs-identifier">Constr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#mkConstr"><span class="hs-identifier">mkConstr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#DataType"><span class="hs-identifier">DataType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#mkDataType"><span class="hs-identifier">mkDataType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#Fixity"><span class="hs-identifier">Fixity</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Data.html#Prefix"><span class="hs-identifier">Prefix</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.html#"><span class="hs-identifier">Data.Binary</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier">Binary</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier">get</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier">put</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier">Monoid</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-213"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier">Semigroup</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#"><span class="hs-identifier">Data.String</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier">IsString</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-215"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.html"><span class="hs-identifier">Data.Text</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">T</span></span><span>
</span><span id="line-216"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.html"><span class="hs-identifier">Data.Text.Internal</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">T</span></span><span>
</span><span id="line-217"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html"><span class="hs-identifier">Data.Text.Internal.Fusion.Common</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-218"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Unsafe.html"><span class="hs-identifier">Data.Text.Unsafe</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">T</span></span><span>
</span><span id="line-219"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html"><span class="hs-identifier">Data.Text.Internal.Lazy.Fusion</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">S</span></span><span>
</span><span id="line-220"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html"><span class="hs-identifier">Data.Text.Internal.Fusion.Types</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html#PairS"><span class="hs-identifier">PairS</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html"><span class="hs-identifier">Data.Text.Internal.Lazy.Fusion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier">stream</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier">unstream</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html"><span class="hs-identifier">Data.Text.Internal.Lazy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier">Text</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier">chunk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier">empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#foldlChunks"><span class="hs-identifier">foldlChunks</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-223"></span><span>                                </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier">foldrChunks</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#smallChunkSize"><span class="hs-identifier">smallChunkSize</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.html"><span class="hs-identifier">Data.Text.Internal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#firstf"><span class="hs-identifier">firstf</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-keyword">safe</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#text"><span class="hs-identifier">text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html"><span class="hs-identifier">Data.Text.Lazy.Encoding</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#decodeUtf8%27"><span class="hs-identifier">decodeUtf8'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Lazy.Encoding.html#encodeUtf8"><span class="hs-identifier">encodeUtf8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Data.Text.Internal.Functions.html"><span class="hs-identifier">Data.Text.Internal.Functions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">F</span></span><span>
</span><span id="line-227"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Search.html"><span class="hs-identifier">Data.Text.Internal.Lazy.Search</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Search.html#indices"><span class="hs-identifier">indices</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#"><span class="hs-identifier">GHC.CString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHC</span></span><span>
</span><span id="line-229"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exts.html#"><span class="hs-identifier">GHC.Exts</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Exts</span></span><span>
</span><span id="line-230"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#"><span class="hs-identifier">GHC.Prim</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Addr%23"><span class="hs-identifier">Addr#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Lib.html#"><span class="hs-identifier">Language.Haskell.TH.Lib</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TH</span></span><span>
</span><span id="line-232"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#"><span class="hs-identifier">Language.Haskell.TH.Syntax</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TH</span></span><span>
</span><span id="line-233"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Text.Printf.html#"><span class="hs-identifier">Text.Printf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Text.Printf.html#PrintfArg"><span class="hs-identifier">PrintfArg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Text.Printf.html#formatArg"><span class="hs-identifier">formatArg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Text.Printf.html#formatString"><span class="hs-identifier">formatString</span></a></span><span class="hs-special">)</span><span class="hs-cpp">

#if defined(ASSERTS)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC.Stack</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">HasCallStack</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-239"></span><span class="hs-comment">-- $fusion</span><span>
</span><span id="line-240"></span><span class="hs-comment">--</span><span>
</span><span id="line-241"></span><span class="hs-comment">-- Most of the functions in this module are subject to /fusion/,</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- meaning that a pipeline of such functions will usually allocate at</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- most one 'Text' value.</span><span>
</span><span id="line-244"></span><span class="hs-comment">--</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- As an example, consider the following pipeline:</span><span>
</span><span id="line-246"></span><span class="hs-comment">--</span><span>
</span><span id="line-247"></span><span class="hs-comment">-- &gt; import Data.Text.Lazy as T</span><span>
</span><span id="line-248"></span><span class="hs-comment">-- &gt; import Data.Text.Lazy.Encoding as E</span><span>
</span><span id="line-249"></span><span class="hs-comment">-- &gt; import Data.ByteString.Lazy (ByteString)</span><span>
</span><span id="line-250"></span><span class="hs-comment">-- &gt;</span><span>
</span><span id="line-251"></span><span class="hs-comment">-- &gt; countChars :: ByteString -&gt; Int</span><span>
</span><span id="line-252"></span><span class="hs-comment">-- &gt; countChars = T.length . T.toUpper . E.decodeUtf8</span><span>
</span><span id="line-253"></span><span class="hs-comment">--</span><span>
</span><span id="line-254"></span><span class="hs-comment">-- From the type signatures involved, this looks like it should</span><span>
</span><span id="line-255"></span><span class="hs-comment">-- allocate one 'ByteString' value, and two 'Text' values. However,</span><span>
</span><span id="line-256"></span><span class="hs-comment">-- when a module is compiled with optimisation enabled under GHC, the</span><span>
</span><span id="line-257"></span><span class="hs-comment">-- two intermediate 'Text' values will be optimised away, and the</span><span>
</span><span id="line-258"></span><span class="hs-comment">-- function will be compiled down to a single loop over the source</span><span>
</span><span id="line-259"></span><span class="hs-comment">-- 'ByteString'.</span><span>
</span><span id="line-260"></span><span class="hs-comment">--</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- Functions that can be fused by the compiler are documented with the</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- phrase \&quot;Subject to fusion\&quot;.</span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="hs-comment">-- $replacement</span><span>
</span><span id="line-265"></span><span class="hs-comment">--</span><span>
</span><span id="line-266"></span><span class="hs-comment">-- A 'Text' value is a sequence of Unicode scalar values, as defined</span><span>
</span><span id="line-267"></span><span class="hs-comment">-- in</span><span>
</span><span id="line-268"></span><span class="hs-comment">-- &lt;http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#page=35 &#167;3.9, definition D76 of the Unicode 5.2 standard &gt;.</span><span>
</span><span id="line-269"></span><span class="hs-comment">-- As such, a 'Text' cannot contain values in the range U+D800 to</span><span>
</span><span id="line-270"></span><span class="hs-comment">-- U+DFFF inclusive. Haskell implementations admit all Unicode code</span><span>
</span><span id="line-271"></span><span class="hs-comment">-- points</span><span>
</span><span id="line-272"></span><span class="hs-comment">-- (&lt;http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#page=13 &#167;3.4, definition D10 &gt;)</span><span>
</span><span id="line-273"></span><span class="hs-comment">-- as 'Char' values, including code points from this invalid range.</span><span>
</span><span id="line-274"></span><span class="hs-comment">-- This means that there are some 'Char' values that are not valid</span><span>
</span><span id="line-275"></span><span class="hs-comment">-- Unicode scalar values, and the functions in this module must handle</span><span>
</span><span id="line-276"></span><span class="hs-comment">-- those cases.</span><span>
</span><span id="line-277"></span><span class="hs-comment">--</span><span>
</span><span id="line-278"></span><span class="hs-comment">-- Within this module, many functions construct a 'Text' from one or</span><span>
</span><span id="line-279"></span><span class="hs-comment">-- more 'Char' values. Those functions will substitute 'Char' values</span><span>
</span><span id="line-280"></span><span class="hs-comment">-- that are not valid Unicode scalar values with the replacement</span><span>
</span><span id="line-281"></span><span class="hs-comment">-- character \&quot;&amp;#xfffd;\&quot; (U+FFFD).  Functions that perform this</span><span>
</span><span id="line-282"></span><span class="hs-comment">-- inspection and replacement are documented with the phrase</span><span>
</span><span id="line-283"></span><span class="hs-comment">-- \&quot;Performs replacement on invalid scalar values\&quot;.</span><span>
</span><span id="line-284"></span><span class="hs-comment">--</span><span>
</span><span id="line-285"></span><span class="hs-comment">-- (One reason for this policy of replacement is that internally, a</span><span>
</span><span id="line-286"></span><span class="hs-comment">-- 'Text' value is represented as packed UTF-16 data. Values in the</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- range U+D800 through U+DFFF are used by UTF-16 to denote surrogate</span><span>
</span><span id="line-288"></span><span class="hs-comment">-- code points, and so cannot be represented. The functions replace</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- invalid scalar values, instead of dropping them, as a security</span><span>
</span><span id="line-290"></span><span class="hs-comment">-- measure. For details, see</span><span>
</span><span id="line-291"></span><span class="hs-comment">-- &lt;http://unicode.org/reports/tr36/#Deletion_of_Noncharacters Unicode Technical Report 36, &#167;3.5 &gt;.)</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="hs-comment">-- $setup</span><span>
</span><span id="line-294"></span><span class="hs-comment">-- &gt;&gt;&gt; import Data.Text</span><span>
</span><span id="line-295"></span><span class="hs-comment">-- &gt;&gt;&gt; import qualified Data.Text as T</span><span>
</span><span id="line-296"></span><span class="hs-comment">-- &gt;&gt;&gt; :seti -XOverloadedStrings</span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span class="annot"><a href="Data.Text.Lazy.html#equal"><span class="hs-identifier hs-type">equal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-299"></span><span id="equal"><span class="annot"><span class="annottext">equal :: Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#equal"><span class="hs-identifier hs-var hs-var">equal</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-300"></span><span class="annot"><a href="Data.Text.Lazy.html#equal"><span class="hs-identifier hs-var">equal</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-301"></span><span class="annot"><a href="Data.Text.Lazy.html#equal"><span class="hs-identifier hs-var">equal</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-302"></span><span class="annot"><a href="Data.Text.Lazy.html#equal"><span class="hs-identifier hs-var">equal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679113049"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113049"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679113048"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113048"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679113047"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113047"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679113046"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113046"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-303"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#compare"><span class="hs-identifier hs-var">compare</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113044"><span class="hs-identifier hs-var">lenA</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113043"><span class="hs-identifier hs-var">lenB</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-304"></span><span>      </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#LT"><span class="hs-identifier hs-var">LT</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113049"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#takeWord16"><span class="hs-identifier hs-var">T.takeWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113044"><span class="hs-identifier hs-var">lenA</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113047"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span>
</span><span id="line-305"></span><span>            </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113048"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#equal"><span class="hs-operator hs-var">`equal`</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#dropWord16"><span class="hs-identifier hs-var">T.dropWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113044"><span class="hs-identifier hs-var">lenA</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113047"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113046"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-306"></span><span>      </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113049"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113047"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113048"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#equal"><span class="hs-operator hs-var">`equal`</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113046"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-307"></span><span>      </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#GT"><span class="hs-identifier hs-var">GT</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#takeWord16"><span class="hs-identifier hs-var">T.takeWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113043"><span class="hs-identifier hs-var">lenB</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113049"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113047"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span>
</span><span id="line-308"></span><span>            </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#dropWord16"><span class="hs-identifier hs-var">T.dropWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113043"><span class="hs-identifier hs-var">lenB</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113049"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113048"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#equal"><span class="hs-operator hs-var">`equal`</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113046"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-309"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679113044"><span class="annot"><span class="annottext">lenA :: Int
</span><a href="#local-6989586621679113044"><span class="hs-identifier hs-var hs-var">lenA</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.Unsafe.html#lengthWord16"><span class="hs-identifier hs-var">T.lengthWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113049"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-310"></span><span>        </span><span id="local-6989586621679113043"><span class="annot"><span class="annottext">lenB :: Int
</span><a href="#local-6989586621679113043"><span class="hs-identifier hs-var hs-var">lenB</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.Unsafe.html#lengthWord16"><span class="hs-identifier hs-var">T.lengthWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113047"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679113037"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-313"></span><span>    </span><span id="local-6989586621679113035"><span class="annot"><span class="annottext">== :: Text -&gt; Text -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#equal"><span class="hs-identifier hs-var">equal</span></a></span><span>
</span><span id="line-314"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">==</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679113020"><span id="local-6989586621679113022"><span id="local-6989586621679113024"><span id="local-6989586621679113026"><span id="local-6989586621679113028"><span id="local-6989586621679113030"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-type">Ord</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-317"></span><span>    </span><span id="local-6989586621679113018"><span class="annot"><span class="annottext">compare :: Text -&gt; Text -&gt; Ordering
</span><a href="#local-6989586621679113018"><span class="hs-identifier hs-var hs-var hs-var hs-var">compare</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Ordering
</span><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var">compareText</span></a></span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="annot"><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-type">compareText</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span><span>
</span><span id="line-320"></span><span id="compareText"><span class="annot"><span class="annottext">compareText :: Text -&gt; Text -&gt; Ordering
</span><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var hs-var">compareText</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span>
</span><span id="line-321"></span><span class="annot"><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var">compareText</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#LT"><span class="hs-identifier hs-var">LT</span></a></span><span>
</span><span id="line-322"></span><span class="annot"><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var">compareText</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>     </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#GT"><span class="hs-identifier hs-var">GT</span></a></span><span>
</span><span id="line-323"></span><span class="annot"><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var">compareText</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679113016"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113016"><span class="hs-identifier hs-var">a0</span></a></span></span><span> </span><span id="local-6989586621679113015"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113015"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679113014"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113014"><span class="hs-identifier hs-var">b0</span></a></span></span><span> </span><span id="local-6989586621679113013"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113013"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Ordering
</span><a href="#local-6989586621679113012"><span class="hs-identifier hs-var">outer</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113016"><span class="hs-identifier hs-var">a0</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113014"><span class="hs-identifier hs-var">b0</span></a></span><span>
</span><span id="line-324"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-325"></span><span>  </span><span id="local-6989586621679113012"><span class="annot"><span class="annottext">outer :: Text -&gt; Text -&gt; Ordering
</span><a href="#local-6989586621679113012"><span class="hs-identifier hs-var hs-var">outer</span></a></span></span><span> </span><span id="local-6989586621679113011"><span class="annot"><span class="annottext">ta :: Text
</span><a href="#local-6989586621679113011"><span class="hs-identifier hs-var">ta</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span id="local-6989586621679113009"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679113009"><span class="hs-identifier hs-var">arrA</span></a></span></span><span> </span><span id="local-6989586621679113008"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113008"><span class="hs-identifier hs-var">offA</span></a></span></span><span> </span><span id="local-6989586621679113007"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113007"><span class="hs-identifier hs-var">lenA</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679113006"><span class="annot"><span class="annottext">tb :: Text
</span><a href="#local-6989586621679113006"><span class="hs-identifier hs-var">tb</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span id="local-6989586621679113005"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679113005"><span class="hs-identifier hs-var">arrB</span></a></span></span><span> </span><span id="local-6989586621679113004"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113004"><span class="hs-identifier hs-var">offB</span></a></span></span><span> </span><span id="local-6989586621679113003"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113003"><span class="hs-identifier hs-var">lenB</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
</span><a href="#local-6989586621679113002"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-326"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-327"></span><span>    </span><span id="local-6989586621679113002"><span class="annot"><span class="annottext">go :: Int -&gt; Int -&gt; Ordering
</span><a href="#local-6989586621679113002"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679113001"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113001"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679113000"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113000"><span class="hs-identifier hs-var">j</span></a></span></span><span>
</span><span id="line-328"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113001"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113007"><span class="hs-identifier hs-var">lenA</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Ordering
</span><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var">compareText</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113015"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Int -&gt; Text
</span><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-var">T.Text</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679113005"><span class="hs-identifier hs-var">arrB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113004"><span class="hs-identifier hs-var">offB</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113000"><span class="hs-identifier hs-var">j</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113003"><span class="hs-identifier hs-var">lenB</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113000"><span class="hs-identifier hs-var">j</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113013"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113000"><span class="hs-identifier hs-var">j</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113003"><span class="hs-identifier hs-var">lenB</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Ordering
</span><a href="Data.Text.Lazy.html#compareText"><span class="hs-identifier hs-var">compareText</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Int -&gt; Text
</span><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-var">T.Text</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679113009"><span class="hs-identifier hs-var">arrA</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113008"><span class="hs-identifier hs-var">offA</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113001"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113007"><span class="hs-identifier hs-var">lenA</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113001"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113015"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113013"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-330"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112999"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112997"><span class="hs-identifier hs-var">b</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#LT"><span class="hs-identifier hs-var">LT</span></a></span><span>
</span><span id="line-331"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112999"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112997"><span class="hs-identifier hs-var">b</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#GT"><span class="hs-identifier hs-var">GT</span></a></span><span>
</span><span id="line-332"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
</span><a href="#local-6989586621679113002"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113001"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112995"><span class="hs-identifier hs-var">di</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113000"><span class="hs-identifier hs-var">j</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112994"><span class="hs-identifier hs-var">dj</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-333"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span class="annot"><a href="Data.Text.Unsafe.html#Iter"><span class="hs-identifier hs-type">T.Iter</span></a></span><span> </span><span id="local-6989586621679112999"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112999"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679112995"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112995"><span class="hs-identifier hs-var">di</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int -&gt; Iter
</span><a href="Data.Text.Unsafe.html#iter"><span class="hs-identifier hs-var">T.iter</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113011"><span class="hs-identifier hs-var">ta</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113001"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-334"></span><span>            </span><span class="annot"><a href="Data.Text.Unsafe.html#Iter"><span class="hs-identifier hs-type">T.Iter</span></a></span><span> </span><span id="local-6989586621679112997"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112997"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621679112994"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112994"><span class="hs-identifier hs-var">dj</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int -&gt; Iter
</span><a href="Data.Text.Unsafe.html#iter"><span class="hs-identifier hs-var">T.iter</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679113006"><span class="hs-identifier hs-var">tb</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679113000"><span class="hs-identifier hs-var">j</span></a></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112987"><span id="local-6989586621679112989"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-337"></span><span>    </span><span id="local-6989586621679112981"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Text -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span id="local-6989586621679112979"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112979"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112978"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112978"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span id="local-6989586621679112977"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112977"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; String -&gt; ShowS
forall a. Show a =&gt; Int -&gt; a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var">showsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112979"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; String
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112978"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112977"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-338"></span><span>
</span><span id="line-339"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112970"><span id="local-6989586621679112972"><span id="local-6989586621679112974"><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-340"></span><span>    </span><span id="local-6989586621679112964"><span class="annot"><span class="annottext">readsPrec :: Int -&gt; ReadS Text
</span><a href="../../base/src/GHC.Read.html#readsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">readsPrec</span></a></span></span><span> </span><span id="local-6989586621679112962"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112962"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112961"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112961"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Text
</span><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112960"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112959"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112960"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112960"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112959"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112959"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS String
forall a. Read a =&gt; Int -&gt; ReadS a
</span><a href="../../base/src/GHC.Read.html#readsPrec"><span class="hs-identifier hs-var">readsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112962"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112961"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span class="hs-comment">-- | @since 1.2.2.0</span><span>
</span><span id="line-343"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112954"><span id="local-6989586621679112956"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-344"></span><span>    </span><span id="local-6989586621679112952"><span class="annot"><span class="annottext">&lt;&gt; :: Text -&gt; Text -&gt; Text
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-identifier hs-var">append</span></a></span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-347"></span><span>    </span><span id="local-6989586621679112944"><span class="annot"><span class="annottext">mempty :: Text
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-348"></span><span>    </span><span id="local-6989586621679112942"><span class="annot"><span class="annottext">mappend :: Text -&gt; Text -&gt; Text
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(&lt;&gt;)</span></a></span><span>
</span><span id="line-349"></span><span>    </span><span id="local-6989586621679112941"><span class="annot"><span class="annottext">mconcat :: [Text] -&gt; Text
</span><a href="../../base/src/GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">mconcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier hs-type">IsString</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-352"></span><span>    </span><span id="local-6989586621679112937"><span class="annot"><span class="annottext">fromString :: String -&gt; Text
</span><a href="../../base/src/Data.String.html#fromString"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
</span><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span class="hs-comment">-- | @since 1.2.0.0</span><span>
</span><span id="line-355"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112934"><span class="annot"><a href="../../base/src/GHC.Exts.html#IsList"><span class="hs-identifier hs-type">Exts.IsList</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-356"></span><span>    </span><span class="hs-keyword">type</span><span> </span><span id="Item"><span class="annot"><a href="../../base/src/GHC.Exts.html#Item"><span class="hs-identifier hs-var">Item</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-357"></span><span>    </span><span id="local-6989586621679112931"><span class="annot"><span class="annottext">fromList :: [Item Text] -&gt; Text
</span><a href="../../base/src/GHC.Exts.html#fromList"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromList</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
[Item Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span>
</span><span id="line-358"></span><span>    </span><span id="local-6989586621679112930"><span class="annot"><span class="annottext">toList :: Text -&gt; [Item Text]
</span><a href="../../base/src/GHC.Exts.html#toList"><span class="hs-identifier hs-var hs-var hs-var hs-var">toList</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; String
Text -&gt; [Item Text]
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-361"></span><span>    </span><span id="local-6989586621679112925"><span class="annot"><span class="annottext">rnf :: Text -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-362"></span><span>    </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679112923"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112923"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112923"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="hs-comment">-- | @since 1.2.1.0</span><span>
</span><span id="line-365"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112919"><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-366"></span><span>    </span><span id="local-6989586621679112915"><span class="annot"><span class="annottext">put :: Text -&gt; Put
</span><a href="#local-6989586621679112915"><span class="hs-identifier hs-var hs-var hs-var hs-var">put</span></a></span></span><span> </span><span id="local-6989586621679112914"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112914"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; ByteString
</span><a href="Data.Text.Lazy.Encoding.html#encodeUtf8"><span class="hs-identifier hs-var">encodeUtf8</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112914"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>    </span><span id="local-6989586621679112905"><span class="annot"><span class="annottext">get :: Get Text
</span><a href="#local-6989586621679112905"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-368"></span><span>      </span><span id="local-6989586621679112904"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112904"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-369"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Either UnicodeException Text
</span><a href="Data.Text.Lazy.Encoding.html#decodeUtf8%27"><span class="hs-identifier hs-var">decodeUtf8'</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679112904"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-370"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">P.Left</span></a></span><span> </span><span id="local-6989586621679112903"><span class="annot"><span class="annottext">UnicodeException
</span><a href="#local-6989586621679112903"><span class="hs-identifier hs-var">exn</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get Text
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">P.fail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnicodeException -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">P.show</span></a></span><span> </span><span class="annot"><span class="annottext">UnicodeException
</span><a href="#local-6989586621679112903"><span class="hs-identifier hs-var">exn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-371"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">P.Right</span></a></span><span> </span><span id="local-6989586621679112901"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112901"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Get Text
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">P.return</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112901"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span class="hs-comment">-- | This instance preserves data abstraction at the cost of inefficiency.</span><span>
</span><span id="line-374"></span><span class="hs-comment">-- We omit reflection services for the sake of data abstraction.</span><span>
</span><span id="line-375"></span><span class="hs-comment">--</span><span>
</span><span id="line-376"></span><span class="hs-comment">-- This instance was created by copying the updated behavior of</span><span>
</span><span id="line-377"></span><span class="hs-comment">-- @&quot;Data.Text&quot;.@'Data.Text.Text'</span><span>
</span><span id="line-378"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112875"><span id="local-6989586621679112877"><span id="local-6989586621679112879"><span id="local-6989586621679112881"><span id="local-6989586621679112883"><span id="local-6989586621679112885"><span id="local-6989586621679112887"><span id="local-6989586621679112889"><span id="local-6989586621679112891"><span id="local-6989586621679112893"><span class="annot"><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-type">Data</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-379"></span><span>  </span><span id="local-6989586621679112869"><span class="annot"><span class="annottext">gfoldl :: forall (c :: * -&gt; *).
(forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b)
-&gt; (forall g. g -&gt; c g) -&gt; Text -&gt; c Text
</span><a href="#local-6989586621679112869"><span class="hs-identifier hs-var hs-var hs-var hs-var">gfoldl</span></a></span></span><span> </span><span id="local-6989586621679112868"><span class="annot"><span class="annottext">forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b
</span><a href="#local-6989586621679112868"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112867"><span class="annot"><span class="annottext">forall g. g -&gt; c g
</span><a href="#local-6989586621679112867"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679112866"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112866"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; Text) -&gt; c (String -&gt; Text)
forall g. g -&gt; c g
</span><a href="#local-6989586621679112867"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
</span><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span> </span><span class="annot"><span class="annottext">c (String -&gt; Text) -&gt; String -&gt; c Text
forall d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b
</span><a href="#local-6989586621679112868"><span class="hs-operator hs-var">`f`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; String
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112866"><span class="hs-identifier hs-var">txt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span>  </span><span id="local-6989586621679112865"><span class="annot"><span class="annottext">toConstr :: Text -&gt; Constr
</span><a href="#local-6989586621679112865"><span class="hs-identifier hs-var hs-var hs-var hs-var">toConstr</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Constr
</span><a href="Data.Text.Lazy.html#packConstr"><span class="hs-identifier hs-var">packConstr</span></a></span><span>
</span><span id="line-381"></span><span>  </span><span id="local-6989586621679112857"><span class="annot"><span class="annottext">gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c Text
</span><a href="#local-6989586621679112857"><span class="hs-identifier hs-var hs-var hs-var hs-var">gunfold</span></a></span></span><span> </span><span id="local-6989586621679112856"><span class="annot"><span class="annottext">forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><a href="#local-6989586621679112856"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679112855"><span class="annot"><span class="annottext">forall r. r -&gt; c r
</span><a href="#local-6989586621679112855"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679112854"><span class="annot"><span class="annottext">Constr
</span><a href="#local-6989586621679112854"><span class="hs-identifier hs-var">c</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Constr -&gt; Int
</span><a href="../../base/src/Data.Data.html#constrIndex"><span class="hs-identifier hs-var">constrIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Constr
</span><a href="#local-6989586621679112854"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-382"></span><span>    </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">c (String -&gt; Text) -&gt; c Text
forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><a href="#local-6989586621679112856"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; Text) -&gt; c (String -&gt; Text)
forall r. r -&gt; c r
</span><a href="#local-6989586621679112855"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
</span><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-var">pack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>    </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; c Text
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Text.Lazy.Text.gunfold&quot;</span></span><span>
</span><span id="line-384"></span><span>  </span><span id="local-6989586621679112853"><span class="annot"><span class="annottext">dataTypeOf :: Text -&gt; DataType
</span><a href="#local-6989586621679112853"><span class="hs-identifier hs-var hs-var hs-var hs-var">dataTypeOf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="Data.Text.Lazy.html#textDataType"><span class="hs-identifier hs-var">textDataType</span></a></span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="hs-comment">-- | This instance has similar considerations to the 'Data' instance:</span><span>
</span><span id="line-387"></span><span class="hs-comment">-- it preserves abstraction at the cost of inefficiency.</span><span>
</span><span id="line-388"></span><span class="hs-comment">--</span><span>
</span><span id="line-389"></span><span class="hs-comment">-- @since 1.2.4.0</span><span>
</span><span id="line-390"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#Lift"><span class="hs-identifier hs-type">TH.Lift</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-391"></span><span>  </span><span id="local-6989586621679112843"><span class="annot"><span class="annottext">lift :: forall (m :: * -&gt; *). Quote m =&gt; Text -&gt; m Exp
</span><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#lift"><span class="hs-identifier hs-var hs-var hs-var hs-var">lift</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m Exp -&gt; m Exp -&gt; m Exp
forall (m :: * -&gt; *). Quote m =&gt; m Exp -&gt; m Exp -&gt; m Exp
</span><a href="../../template-haskell/src/Language.Haskell.TH.Lib.Internal.html#appE"><span class="hs-identifier hs-var">TH.appE</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; m Exp
forall (m :: * -&gt; *). Quote m =&gt; Name -&gt; m Exp
</span><a href="../../template-haskell/src/Language.Haskell.TH.Lib.Internal.html#varE"><span class="hs-identifier hs-var">TH.varE</span></a></span><span> </span><span class="hs-special">'</span><span class="hs-identifier">pack</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m Exp -&gt; m Exp) -&gt; (Text -&gt; m Exp) -&gt; Text -&gt; m Exp
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; m Exp
forall (m :: * -&gt; *). Quote m =&gt; String -&gt; m Exp
</span><a href="../../template-haskell/src/Language.Haskell.TH.Lib.Internal.html#stringE"><span class="hs-identifier hs-var">TH.stringE</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; m Exp) -&gt; (Text -&gt; String) -&gt; Text -&gt; m Exp
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; String
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span class="hs-cpp">
#if MIN_VERSION_template_haskell(2,17,0)
</span><span>  </span><span id="local-6989586621679112837"><span class="annot"><span class="annottext">liftTyped :: forall (m :: * -&gt; *). Quote m =&gt; Text -&gt; Code m Text
</span><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#liftTyped"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftTyped</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m Exp -&gt; Code m Text
forall a (m :: * -&gt; *). Quote m =&gt; m Exp -&gt; Code m a
</span><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#unsafeCodeCoerce"><span class="hs-identifier hs-var">TH.unsafeCodeCoerce</span></a></span><span> </span><span class="annot"><span class="annottext">(m Exp -&gt; Code m Text) -&gt; (Text -&gt; m Exp) -&gt; Text -&gt; Code m Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; m Exp
forall t (m :: * -&gt; *). (Lift t, Quote m) =&gt; t -&gt; m Exp
</span><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#lift"><span class="hs-identifier hs-var">TH.lift</span></a></span><span class="hs-cpp">
#elif MIN_VERSION_template_haskell(2,16,0)
</span><span>  </span><span class="hs-identifier">liftTyped</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">TH.unsafeTExpCoerce</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">TH.lift</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-398"></span><span class="hs-comment">-- | @since 1.2.2.0</span><span>
</span><span id="line-399"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679112834"><span class="annot"><a href="../../base/src/Text.Printf.html#PrintfArg"><span class="hs-identifier hs-type">PrintfArg</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-400"></span><span>  </span><span id="local-6989586621679112830"><span class="annot"><span class="annottext">formatArg :: Text -&gt; FieldFormatter
</span><a href="#local-6989586621679112830"><span class="hs-identifier hs-var hs-var hs-var hs-var">formatArg</span></a></span></span><span> </span><span id="local-6989586621679112829"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112829"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FieldFormatter
forall a. IsChar a =&gt; [a] -&gt; FieldFormatter
</span><a href="../../base/src/Text.Printf.html#formatString"><span class="hs-identifier hs-var">formatString</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; FieldFormatter) -&gt; String -&gt; FieldFormatter
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; String
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112829"><span class="hs-identifier hs-var">txt</span></a></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="annot"><a href="Data.Text.Lazy.html#packConstr"><span class="hs-identifier hs-type">packConstr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#Constr"><span class="hs-identifier hs-type">Constr</span></a></span><span>
</span><span id="line-403"></span><span id="packConstr"><span class="annot"><span class="annottext">packConstr :: Constr
</span><a href="Data.Text.Lazy.html#packConstr"><span class="hs-identifier hs-var hs-var">packConstr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataType -&gt; String -&gt; [String] -&gt; Fixity -&gt; Constr
</span><a href="../../base/src/Data.Data.html#mkConstr"><span class="hs-identifier hs-var">mkConstr</span></a></span><span> </span><span class="annot"><span class="annottext">DataType
</span><a href="Data.Text.Lazy.html#textDataType"><span class="hs-identifier hs-var">textDataType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pack&quot;</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="../../base/src/Data.Data.html#Prefix"><span class="hs-identifier hs-var">Prefix</span></a></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="annot"><a href="Data.Text.Lazy.html#textDataType"><span class="hs-identifier hs-type">textDataType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#DataType"><span class="hs-identifier hs-type">DataType</span></a></span><span>
</span><span id="line-406"></span><span id="textDataType"><span class="annot"><span class="annottext">textDataType :: DataType
</span><a href="Data.Text.Lazy.html#textDataType"><span class="hs-identifier hs-var hs-var">textDataType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Constr] -&gt; DataType
</span><a href="../../base/src/Data.Data.html#mkDataType"><span class="hs-identifier hs-var">mkDataType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Text.Lazy.Text&quot;</span></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Constr
</span><a href="Data.Text.Lazy.html#packConstr"><span class="hs-identifier hs-var">packConstr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span class="hs-comment">-- | /O(n)/ Convert a 'String' into a 'Text'.</span><span>
</span><span id="line-409"></span><span class="hs-comment">--</span><span>
</span><span id="line-410"></span><span class="hs-comment">-- Subject to fusion.  Performs replacement on invalid scalar values.</span><span>
</span><span id="line-411"></span><span class="annot"><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-type">pack</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-416"></span><span id="pack"><span class="annot"><span class="annottext">pack :: String -&gt; Text
</span><a href="Data.Text.Lazy.html#pack"><span class="hs-identifier hs-var hs-var">pack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="annot"><span class="annottext">(Stream Char -&gt; Text) -&gt; (String -&gt; Stream Char) -&gt; String -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Stream Char
forall a. [a] -&gt; Stream a
</span><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-identifier hs-var">S.streamList</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Stream Char) -&gt; ShowS -&gt; String -&gt; Stream Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; ShowS
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span>
</span><span id="line-417"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#pack"><span class="hs-pragma hs-type">pack</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span class="hs-comment">-- | /O(n)/ Convert a 'Text' into a 'String'.</span><span>
</span><span id="line-420"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-421"></span><span class="annot"><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-type">unpack</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-426"></span><span id="unpack"><span class="annot"><span class="annottext">unpack :: Text -&gt; String
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var hs-var">unpack</span></a></span></span><span> </span><span id="local-6989586621679112827"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112827"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; String
forall a. Stream a -&gt; [a]
</span><a href="Data.Text.Internal.Fusion.Common.html#unstreamList"><span class="hs-identifier hs-var">S.unstreamList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112827"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unpack"><span class="hs-pragma hs-type">unpack</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span class="hs-comment">-- | /O(n)/ Convert a literal string into a Text.</span><span>
</span><span id="line-430"></span><span class="annot"><a href="Data.Text.Lazy.html#unpackCString%23"><span class="hs-identifier hs-type">unpackCString#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Addr%23"><span class="hs-identifier hs-type">Addr#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-431"></span><span id="unpackCString%23"><span class="annot"><span class="annottext">unpackCString# :: Addr# -&gt; Text
</span><a href="Data.Text.Lazy.html#unpackCString%23"><span class="hs-identifier hs-var hs-var">unpackCString#</span></a></span></span><span> </span><span id="local-6989586621679112824"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679112824"><span class="hs-identifier hs-var">addr#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#streamCString%23"><span class="hs-identifier hs-var">S.streamCString#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679112824"><span class="hs-identifier hs-var">addr#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT literal&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112822"><span class="annot"><a href="#local-6989586621679112822"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-435"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#map"><span class="hs-pragma hs-type">L.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCString%23"><span class="hs-pragma hs-type">GHC.unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112822"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-436"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112822"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;TEXT literal UTF8&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112821"><span class="annot"><a href="#local-6989586621679112821"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-439"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#map"><span class="hs-pragma hs-type">L.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-pragma hs-type">GHC.unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112821"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-440"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unpackCString%23"><span class="hs-pragma hs-type">unpackCString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112821"><span class="hs-pragma hs-type">a</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT empty literal&quot;</span></span><span>
</span><span id="line-443"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#map"><span class="hs-pragma hs-type">L.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">]</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-444"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-pragma hs-type">Empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-445"></span><span>
</span><span id="line-446"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT empty literal&quot;</span></span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112820"><span class="annot"><a href="#local-6989586621679112820"><span class="hs-pragma hs-var">a</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-447"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#streamList"><span class="hs-pragma hs-type">S.streamList</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#map"><span class="hs-pragma hs-type">L.map</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.html#safe"><span class="hs-pragma hs-type">safe</span></a></span><span> </span><span class="hs-pragma">[</span><span class="annot"><a href="#local-6989586621679112820"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">]</span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-448"></span><span>      </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-pragma hs-type">Chunk</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Show.html#singleton"><span class="hs-pragma hs-type">T.singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112820"><span class="hs-pragma hs-type">a</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-pragma hs-type">Empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span class="hs-comment">-- | /O(1)/ Convert a character into a Text.  Subject to fusion.</span><span>
</span><span id="line-451"></span><span class="hs-comment">-- Performs replacement on invalid scalar values.</span><span>
</span><span id="line-452"></span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-identifier hs-type">singleton</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-453"></span><span id="singleton"><span class="annot"><span class="annottext">singleton :: Char -&gt; Text
</span><a href="Data.Text.Lazy.html#singleton"><span class="hs-identifier hs-var hs-var">singleton</span></a></span></span><span> </span><span id="local-6989586621679112818"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112818"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="Data.Text.Show.html#singleton"><span class="hs-identifier hs-var">T.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112818"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-454"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-455"></span><span>
</span><span id="line-456"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-457"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT singleton -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112817"><span class="annot"><a href="#local-6989586621679112817"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-458"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112817"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#singleton"><span class="hs-pragma hs-type">S.singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112817"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-459"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT singleton -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112815"><span class="annot"><a href="#local-6989586621679112815"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-460"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#singleton"><span class="hs-pragma hs-type">S.singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112815"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112815"><span class="hs-pragma hs-type">c</span></a></span><span>
</span><span id="line-461"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="hs-comment">-- | /O(c)/ Convert a list of strict 'T.Text's into a lazy 'Text'.</span><span>
</span><span id="line-464"></span><span class="annot"><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier hs-type">fromChunks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-465"></span><span id="fromChunks"><span class="annot"><span class="annottext">fromChunks :: [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier hs-var hs-var">fromChunks</span></a></span></span><span> </span><span id="local-6989586621679112814"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112814"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text) -&gt; Text -&gt; [Text] -&gt; Text
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">L.foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112814"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span class="hs-comment">-- | /O(n)/ Convert a lazy 'Text' into a list of strict 'T.Text's.</span><span>
</span><span id="line-468"></span><span class="annot"><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier hs-type">toChunks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-469"></span><span id="toChunks"><span class="annot"><span class="annottext">toChunks :: Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier hs-var hs-var">toChunks</span></a></span></span><span> </span><span id="local-6989586621679112812"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112812"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; [Text] -&gt; [Text]) -&gt; [Text] -&gt; Text -&gt; [Text]
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112812"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-470"></span><span>
</span><span id="line-471"></span><span class="hs-comment">-- | /O(n)/ Convert a lazy 'Text' into a strict 'T.Text'.</span><span>
</span><span id="line-472"></span><span class="annot"><a href="Data.Text.Lazy.html#toStrict"><span class="hs-identifier hs-type">toStrict</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span>
</span><span id="line-473"></span><span id="toStrict"><span class="annot"><span class="annottext">toStrict :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#toStrict"><span class="hs-identifier hs-var hs-var">toStrict</span></a></span></span><span> </span><span id="local-6989586621679112811"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112811"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.html#concat"><span class="hs-identifier hs-var">T.concat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier hs-var">toChunks</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112811"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-474"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toStrict"><span class="hs-pragma hs-type">toStrict</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span class="hs-comment">-- | /O(c)/ Convert a strict 'T.Text' into a lazy 'Text'.</span><span>
</span><span id="line-477"></span><span class="annot"><a href="Data.Text.Lazy.html#fromStrict"><span class="hs-identifier hs-type">fromStrict</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-478"></span><span id="fromStrict"><span class="annot"><span class="annottext">fromStrict :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#fromStrict"><span class="hs-identifier hs-var hs-var">fromStrict</span></a></span></span><span> </span><span id="local-6989586621679112809"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112809"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112809"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-479"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#fromStrict"><span class="hs-pragma hs-type">fromStrict</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-480"></span><span>
</span><span id="line-481"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-482"></span><span class="hs-comment">-- * Basic functions</span><span>
</span><span id="line-483"></span><span>
</span><span id="line-484"></span><span class="hs-comment">-- | /O(1)/ Adds a character to the front of a 'Text'.  Subject to fusion.</span><span>
</span><span id="line-485"></span><span class="annot"><a href="Data.Text.Lazy.html#cons"><span class="hs-identifier hs-type">cons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-486"></span><span id="cons"><span class="annot"><span class="annottext">cons :: Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#cons"><span class="hs-identifier hs-var hs-var">cons</span></a></span></span><span> </span><span id="local-6989586621679112808"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112808"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112807"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112807"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="Data.Text.Show.html#singleton"><span class="hs-identifier hs-var">T.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112808"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112807"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-487"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#cons"><span class="hs-pragma hs-type">cons</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-488"></span><span>
</span><span id="line-489"></span><span class="hs-keyword">infixr</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#cons"><span class="hs-operator hs-type">`cons`</span></a></span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-492"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT cons -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112806"><span class="annot"><a href="#local-6989586621679112806"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112805"><span class="annot"><a href="#local-6989586621679112805"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-493"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#cons"><span class="hs-pragma hs-type">cons</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112806"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112805"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#cons"><span class="hs-pragma hs-type">S.cons</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112806"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112805"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-494"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT cons -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112803"><span class="annot"><a href="#local-6989586621679112803"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112802"><span class="annot"><a href="#local-6989586621679112802"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-495"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#cons"><span class="hs-pragma hs-type">S.cons</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112803"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112802"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#cons"><span class="hs-pragma hs-type">cons</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112803"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112802"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-496"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-497"></span><span>
</span><span id="line-498"></span><span class="hs-comment">-- | /O(n)/ Adds a character to the end of a 'Text'.  This copies the</span><span>
</span><span id="line-499"></span><span class="hs-comment">-- entire array in the process, unless fused.  Subject to fusion.</span><span>
</span><span id="line-500"></span><span class="annot"><a href="Data.Text.Lazy.html#snoc"><span class="hs-identifier hs-type">snoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-501"></span><span id="snoc"><span class="annot"><span class="annottext">snoc :: Text -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#snoc"><span class="hs-identifier hs-var hs-var">snoc</span></a></span></span><span> </span><span id="local-6989586621679112801"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112801"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112800"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112800"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text) -&gt; Text -&gt; Text -&gt; Text
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="Data.Text.Lazy.html#singleton"><span class="hs-identifier hs-var">singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112800"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112801"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-502"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#snoc"><span class="hs-pragma hs-type">snoc</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-505"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT snoc -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112799"><span class="annot"><a href="#local-6989586621679112799"><span class="hs-pragma hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112798"><span class="annot"><a href="#local-6989586621679112798"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-506"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#snoc"><span class="hs-pragma hs-type">snoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112799"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112798"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#snoc"><span class="hs-pragma hs-type">S.snoc</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112799"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679112798"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-507"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT snoc -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112796"><span class="annot"><a href="#local-6989586621679112796"><span class="hs-pragma hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112795"><span class="annot"><a href="#local-6989586621679112795"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-508"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#snoc"><span class="hs-pragma hs-type">S.snoc</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112796"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679112795"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#snoc"><span class="hs-pragma hs-type">snoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112796"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112795"><span class="hs-pragma hs-type">c</span></a></span><span>
</span><span id="line-509"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-510"></span><span>
</span><span id="line-511"></span><span class="hs-comment">-- | /O(n\/c)/ Appends one 'Text' to another.  Subject to fusion.</span><span>
</span><span id="line-512"></span><span class="annot"><a href="Data.Text.Lazy.html#append"><span class="hs-identifier hs-type">append</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-513"></span><span id="append"><span class="annot"><span class="annottext">append :: Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-identifier hs-var hs-var">append</span></a></span></span><span> </span><span id="local-6989586621679112794"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112794"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679112793"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112793"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text) -&gt; Text -&gt; Text -&gt; Text
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112793"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112794"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-514"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#append"><span class="hs-pragma hs-type">append</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-515"></span><span>
</span><span id="line-516"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-517"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT append -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112792"><span class="annot"><a href="#local-6989586621679112792"><span class="hs-pragma hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621679112791"><span class="annot"><a href="#local-6989586621679112791"><span class="hs-pragma hs-var">t2</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-518"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#append"><span class="hs-pragma hs-type">append</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112792"><span class="hs-pragma hs-type">t1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112791"><span class="hs-pragma hs-type">t2</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#append"><span class="hs-pragma hs-type">S.append</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112792"><span class="hs-pragma hs-type">t1</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112791"><span class="hs-pragma hs-type">t2</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-519"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT append -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112789"><span class="annot"><a href="#local-6989586621679112789"><span class="hs-pragma hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621679112788"><span class="annot"><a href="#local-6989586621679112788"><span class="hs-pragma hs-var">t2</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-520"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#append"><span class="hs-pragma hs-type">S.append</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112789"><span class="hs-pragma hs-type">t1</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112788"><span class="hs-pragma hs-type">t2</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#append"><span class="hs-pragma hs-type">append</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112789"><span class="hs-pragma hs-type">t1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112788"><span class="hs-pragma hs-type">t2</span></a></span><span>
</span><span id="line-521"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="hs-comment">-- | /O(1)/ Returns the first character and rest of a 'Text', or</span><span>
</span><span id="line-524"></span><span class="hs-comment">-- 'Nothing' if empty. Subject to fusion.</span><span>
</span><span id="line-525"></span><span class="annot"><a href="Data.Text.Lazy.html#uncons"><span class="hs-identifier hs-type">uncons</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-526"></span><span id="uncons"><span class="annot"><span class="annottext">uncons :: Text -&gt; Maybe (Char, Text)
</span><a href="Data.Text.Lazy.html#uncons"><span class="hs-identifier hs-var hs-var">uncons</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, Text)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-527"></span><span class="annot"><a href="Data.Text.Lazy.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112787"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112787"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112786"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112786"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char, Text) -&gt; Maybe (Char, Text)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">T.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112787"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112784"><span class="hs-identifier hs-var">ts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112784"><span class="annot"><span class="annottext">ts' :: Text
</span><a href="#local-6989586621679112784"><span class="hs-identifier hs-var hs-var">ts'</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int -&gt; Ordering
</span><a href="Data.Text.html#compareLength"><span class="hs-identifier hs-var">T.compareLength</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112787"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Ordering -&gt; Ordering -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Ordering
</span><a href="../../ghc-prim/src/GHC.Types.html#EQ"><span class="hs-identifier hs-var">EQ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112786"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-529"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">T.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112787"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112786"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-530"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#uncons"><span class="hs-pragma hs-type">uncons</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-531"></span><span>
</span><span id="line-532"></span><span class="hs-comment">-- | /O(1)/ Returns the first character of a 'Text', which must be</span><span>
</span><span id="line-533"></span><span class="hs-comment">-- non-empty.  Subject to fusion.</span><span>
</span><span id="line-534"></span><span class="annot"><a href="Data.Text.Lazy.html#head"><span class="hs-identifier hs-type">head</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-535"></span><span id="head"><span class="annot"><span class="annottext">head :: Text -&gt; Char
</span><a href="Data.Text.Lazy.html#head"><span class="hs-identifier hs-var hs-var">head</span></a></span></span><span> </span><span id="local-6989586621679112781"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112781"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Char
</span><a href="Data.Text.Internal.Fusion.Common.html#head"><span class="hs-identifier hs-var">S.head</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112781"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-536"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#head"><span class="hs-pragma hs-type">head</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span class="hs-comment">-- | /O(1)/ Returns all characters after the head of a 'Text', which</span><span>
</span><span id="line-539"></span><span class="hs-comment">-- must be non-empty.  Subject to fusion.</span><span>
</span><span id="line-540"></span><span class="annot"><a href="Data.Text.Lazy.html#tail"><span class="hs-identifier hs-type">tail</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-541"></span><span id="tail"><span class="annot"><span class="annottext">tail :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#tail"><span class="hs-identifier hs-var hs-var">tail</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112779"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112779"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112778"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112778"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.html#tail"><span class="hs-identifier hs-var">T.tail</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112779"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112778"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-542"></span><span class="annot"><a href="Data.Text.Lazy.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tail&quot;</span></span><span>
</span><span id="line-543"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#tail"><span class="hs-pragma hs-type">tail</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-544"></span><span>
</span><span id="line-545"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-546"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT tail -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112775"><span class="annot"><a href="#local-6989586621679112775"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-547"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#tail"><span class="hs-pragma hs-type">tail</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112775"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#tail"><span class="hs-pragma hs-type">S.tail</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112775"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-548"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT tail -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112773"><span class="annot"><a href="#local-6989586621679112773"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-549"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#tail"><span class="hs-pragma hs-type">S.tail</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112773"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#tail"><span class="hs-pragma hs-type">tail</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112773"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-550"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-551"></span><span>
</span><span id="line-552"></span><span class="hs-comment">-- | /O(n\/c)/ Returns all but the last character of a 'Text', which must</span><span>
</span><span id="line-553"></span><span class="hs-comment">-- be non-empty.  Subject to fusion.</span><span>
</span><span id="line-554"></span><span class="annot"><a href="Data.Text.Lazy.html#init"><span class="hs-identifier hs-type">init</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-555"></span><span id="init"><span class="annot"><span class="annottext">init :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#init"><span class="hs-identifier hs-var hs-var">init</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112772"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112772"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span id="local-6989586621679112771"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112771"><span class="hs-identifier hs-var">ts0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112770"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112772"><span class="hs-identifier hs-var">t0</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112771"><span class="hs-identifier hs-var">ts0</span></a></span><span>
</span><span id="line-556"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112770"><span class="annot"><span class="annottext">go :: Text -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112770"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112769"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112769"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112768"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112768"><span class="hs-identifier hs-var">t'</span></a></span></span><span> </span><span id="local-6989586621679112767"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112767"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112769"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112770"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112768"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112767"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-557"></span><span>          </span><span class="annot"><a href="#local-6989586621679112770"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679112766"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112766"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.html#init"><span class="hs-identifier hs-var">T.init</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112766"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-558"></span><span class="annot"><a href="Data.Text.Lazy.html#init"><span class="hs-identifier hs-var">init</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;init&quot;</span></span><span>
</span><span id="line-559"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#init"><span class="hs-pragma hs-type">init</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-562"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT init -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112764"><span class="annot"><a href="#local-6989586621679112764"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-563"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#init"><span class="hs-pragma hs-type">init</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112764"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#init"><span class="hs-pragma hs-type">S.init</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112764"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-564"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT init -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112762"><span class="annot"><a href="#local-6989586621679112762"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-565"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#init"><span class="hs-pragma hs-type">S.init</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112762"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#init"><span class="hs-pragma hs-type">init</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112762"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-566"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-567"></span><span>
</span><span id="line-568"></span><span class="hs-comment">-- | /O(n\/c)/ Returns the 'init' and 'last' of a 'Text', or 'Nothing' if</span><span>
</span><span id="line-569"></span><span class="hs-comment">-- empty.</span><span>
</span><span id="line-570"></span><span class="hs-comment">--</span><span>
</span><span id="line-571"></span><span class="hs-comment">-- * It is no faster than using 'init' and 'last'.</span><span>
</span><span id="line-572"></span><span class="hs-comment">--</span><span>
</span><span id="line-573"></span><span class="hs-comment">-- @since 1.2.3.0</span><span>
</span><span id="line-574"></span><span class="annot"><a href="Data.Text.Lazy.html#unsnoc"><span class="hs-identifier hs-type">unsnoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-575"></span><span id="unsnoc"><span class="annot"><span class="annottext">unsnoc :: Text -&gt; Maybe (Text, Char)
</span><a href="Data.Text.Lazy.html#unsnoc"><span class="hs-identifier hs-var hs-var">unsnoc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Text, Char)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-576"></span><span class="annot"><a href="Data.Text.Lazy.html#unsnoc"><span class="hs-identifier hs-var">unsnoc</span></a></span><span> </span><span id="local-6989586621679112761"><span class="annot"><span class="annottext">ts :: Text
</span><a href="#local-6989586621679112761"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text, Char) -&gt; Maybe (Text, Char)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#init"><span class="hs-identifier hs-var">init</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112761"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Lazy.html#last"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112761"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unsnoc"><span class="hs-pragma hs-type">unsnoc</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-578"></span><span>
</span><span id="line-579"></span><span class="hs-comment">-- | /O(1)/ Tests whether a 'Text' is empty or not.  Subject to</span><span>
</span><span id="line-580"></span><span class="hs-comment">-- fusion.</span><span>
</span><span id="line-581"></span><span class="annot"><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-type">null</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-582"></span><span id="null"><span class="annot"><span class="annottext">null :: Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var hs-var">null</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-583"></span><span class="annot"><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-584"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#null"><span class="hs-pragma hs-type">null</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-587"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT null -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112760"><span class="annot"><a href="#local-6989586621679112760"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-588"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#null"><span class="hs-pragma hs-type">null</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112760"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#null"><span class="hs-pragma hs-type">S.null</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112760"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-589"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT null -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112758"><span class="annot"><a href="#local-6989586621679112758"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-590"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#null"><span class="hs-pragma hs-type">S.null</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112758"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#null"><span class="hs-pragma hs-type">null</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112758"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-591"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="hs-comment">-- | /O(1)/ Tests whether a 'Text' contains exactly one character.</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-595"></span><span class="annot"><a href="Data.Text.Lazy.html#isSingleton"><span class="hs-identifier hs-type">isSingleton</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-596"></span><span id="isSingleton"><span class="annot"><span class="annottext">isSingleton :: Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isSingleton"><span class="hs-identifier hs-var hs-var">isSingleton</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Bool
</span><a href="Data.Text.Internal.Fusion.Common.html#isSingleton"><span class="hs-identifier hs-var">S.isSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">(Stream Char -&gt; Bool) -&gt; (Text -&gt; Stream Char) -&gt; Text -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span>
</span><span id="line-597"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isSingleton"><span class="hs-pragma hs-type">isSingleton</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-598"></span><span>
</span><span id="line-599"></span><span class="hs-comment">-- | /O(n\/c)/ Returns the last character of a 'Text', which must be</span><span>
</span><span id="line-600"></span><span class="hs-comment">-- non-empty.  Subject to fusion.</span><span>
</span><span id="line-601"></span><span class="annot"><a href="Data.Text.Lazy.html#last"><span class="hs-identifier hs-type">last</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-602"></span><span id="last"><span class="annot"><span class="annottext">last :: Text -&gt; Char
</span><a href="Data.Text.Lazy.html#last"><span class="hs-identifier hs-var hs-var">last</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Char
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;last&quot;</span></span><span>
</span><span id="line-603"></span><span class="annot"><a href="Data.Text.Lazy.html#last"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112755"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112755"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112754"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112754"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Char
</span><a href="#local-6989586621679112753"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112755"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112754"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-604"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112753"><span class="annot"><span class="annottext">go :: Text -&gt; Text -&gt; Char
</span><a href="#local-6989586621679112753"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112752"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112752"><span class="hs-identifier hs-var">t'</span></a></span></span><span> </span><span id="local-6989586621679112751"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112751"><span class="hs-identifier hs-var">ts'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Char
</span><a href="#local-6989586621679112753"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112752"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112751"><span class="hs-identifier hs-var">ts'</span></a></span><span>
</span><span id="line-605"></span><span>          </span><span class="annot"><a href="#local-6989586621679112753"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679112750"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112750"><span class="hs-identifier hs-var">t'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.html#last"><span class="hs-identifier hs-var">T.last</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112750"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-606"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#last"><span class="hs-pragma hs-type">last</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-607"></span><span>
</span><span id="line-608"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-609"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT last -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112748"><span class="annot"><a href="#local-6989586621679112748"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-610"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#last"><span class="hs-pragma hs-type">last</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112748"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#last"><span class="hs-pragma hs-type">S.last</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112748"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-611"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT last -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112746"><span class="annot"><a href="#local-6989586621679112746"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-612"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#last"><span class="hs-pragma hs-type">S.last</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112746"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#last"><span class="hs-pragma hs-type">last</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112746"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-613"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span class="hs-comment">-- | /O(n)/ Returns the number of characters in a 'Text'.</span><span>
</span><span id="line-616"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-617"></span><span class="annot"><a href="Data.Text.Lazy.html#length"><span class="hs-identifier hs-type">length</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-618"></span><span id="length"><span class="annot"><span class="annottext">length :: Text -&gt; Int64
</span><a href="Data.Text.Lazy.html#length"><span class="hs-identifier hs-var hs-var">length</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Text -&gt; Int64) -&gt; Int64 -&gt; Text -&gt; Int64
forall a. (a -&gt; Text -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldlChunks"><span class="hs-identifier hs-var">foldlChunks</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Int64
</span><a href="#local-6989586621679112745"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span>
</span><span id="line-619"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-620"></span><span>        </span><span class="annot"><a href="#local-6989586621679112745"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-621"></span><span>        </span><span id="local-6989586621679112745"><span class="annot"><span class="annottext">go :: Int64 -&gt; Text -&gt; Int64
</span><a href="#local-6989586621679112745"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112744"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112744"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679112743"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112743"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112744"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112743"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-622"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#length"><span class="hs-pragma hs-type">length</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-623"></span><span>
</span><span id="line-624"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-625"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT length -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112740"><span class="annot"><a href="#local-6989586621679112740"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-626"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#length"><span class="hs-pragma hs-type">length</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112740"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#length"><span class="hs-pragma hs-type">S.length</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112740"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-627"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT length -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112738"><span class="annot"><a href="#local-6989586621679112738"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-628"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#length"><span class="hs-pragma hs-type">S.length</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112738"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#length"><span class="hs-pragma hs-type">length</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112738"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-629"></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-630"></span><span>
</span><span id="line-631"></span><span class="hs-comment">-- | /O(n)/ Compare the count of characters in a 'Text' to a number.</span><span>
</span><span id="line-632"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-633"></span><span class="hs-comment">--</span><span>
</span><span id="line-634"></span><span class="hs-comment">-- This function gives the same answer as comparing against the result</span><span>
</span><span id="line-635"></span><span class="hs-comment">-- of 'length', but can short circuit if the count of characters is</span><span>
</span><span id="line-636"></span><span class="hs-comment">-- greater than the number, and hence be more efficient.</span><span>
</span><span id="line-637"></span><span class="annot"><a href="Data.Text.Lazy.html#compareLength"><span class="hs-identifier hs-type">compareLength</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Ordering"><span class="hs-identifier hs-type">Ordering</span></a></span><span>
</span><span id="line-638"></span><span id="compareLength"><span class="annot"><span class="annottext">compareLength :: Text -&gt; Int64 -&gt; Ordering
</span><a href="Data.Text.Lazy.html#compareLength"><span class="hs-identifier hs-var hs-var">compareLength</span></a></span></span><span> </span><span id="local-6989586621679112737"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112737"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112736"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112736"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Int64 -&gt; Ordering
forall a. Integral a =&gt; Stream Char -&gt; a -&gt; Ordering
</span><a href="Data.Text.Internal.Fusion.Common.html#compareLengthI"><span class="hs-identifier hs-var">S.compareLengthI</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112737"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112736"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-639"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#compareLength"><span class="hs-pragma hs-type">compareLength</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="hs-comment">-- We don't apply those otherwise appealing length-to-compareLength</span><span>
</span><span id="line-642"></span><span class="hs-comment">-- rewrite rules here, because they can change the strictness</span><span>
</span><span id="line-643"></span><span class="hs-comment">-- properties of code.</span><span>
</span><span id="line-644"></span><span>
</span><span id="line-645"></span><span class="hs-comment">-- | /O(n)/ 'map' @f@ @t@ is the 'Text' obtained by applying @f@ to</span><span>
</span><span id="line-646"></span><span class="hs-comment">-- each element of @t@.  Subject to fusion.  Performs replacement on</span><span>
</span><span id="line-647"></span><span class="hs-comment">-- invalid scalar values.</span><span>
</span><span id="line-648"></span><span class="annot"><a href="Data.Text.Lazy.html#map"><span class="hs-identifier hs-type">map</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-649"></span><span id="map"><span class="annot"><span class="annottext">map :: (Char -&gt; Char) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#map"><span class="hs-identifier hs-var hs-var">map</span></a></span></span><span> </span><span id="local-6989586621679112734"><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679112734"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112733"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112733"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#map"><span class="hs-identifier hs-var">S.map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; (Char -&gt; Char) -&gt; Char -&gt; Char
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679112734"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112733"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-650"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#map"><span class="hs-pragma hs-type">map</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-651"></span><span>
</span><span id="line-652"></span><span class="hs-comment">-- | /O(n)/ The 'intercalate' function takes a 'Text' and a list of</span><span>
</span><span id="line-653"></span><span class="hs-comment">-- 'Text's and concatenates the list after interspersing the first</span><span>
</span><span id="line-654"></span><span class="hs-comment">-- argument between each element of the list.</span><span>
</span><span id="line-655"></span><span class="annot"><a href="Data.Text.Lazy.html#intercalate"><span class="hs-identifier hs-type">intercalate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-656"></span><span id="intercalate"><span class="annot"><span class="annottext">intercalate :: Text -&gt; [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#intercalate"><span class="hs-identifier hs-var hs-var">intercalate</span></a></span></span><span> </span><span id="local-6989586621679112731"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112731"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; ([Text] -&gt; [Text]) -&gt; [Text] -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="Data.Text.Internal.Functions.html#intersperse"><span class="hs-identifier hs-var">F.intersperse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112731"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-657"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#intercalate"><span class="hs-pragma hs-type">intercalate</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span class="hs-comment">-- | /O(n)/ The 'intersperse' function takes a character and places it</span><span>
</span><span id="line-660"></span><span class="hs-comment">-- between the characters of a 'Text'.  Subject to fusion.  Performs</span><span>
</span><span id="line-661"></span><span class="hs-comment">-- replacement on invalid scalar values.</span><span>
</span><span id="line-662"></span><span class="annot"><a href="Data.Text.Lazy.html#intersperse"><span class="hs-identifier hs-type">intersperse</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-663"></span><span id="intersperse"><span class="annot"><span class="annottext">intersperse :: Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#intersperse"><span class="hs-identifier hs-var hs-var">intersperse</span></a></span></span><span> </span><span id="local-6989586621679112729"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112729"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112728"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112728"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#intersperse"><span class="hs-identifier hs-var">S.intersperse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112729"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112728"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-664"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#intersperse"><span class="hs-pragma hs-type">intersperse</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-665"></span><span>
</span><span id="line-666"></span><span class="hs-comment">-- | /O(n)/ Left-justify a string to the given length, using the</span><span>
</span><span id="line-667"></span><span class="hs-comment">-- specified fill character on the right. Subject to fusion.  Performs</span><span>
</span><span id="line-668"></span><span class="hs-comment">-- replacement on invalid scalar values.</span><span>
</span><span id="line-669"></span><span class="hs-comment">--</span><span>
</span><span id="line-670"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-671"></span><span class="hs-comment">--</span><span>
</span><span id="line-672"></span><span class="hs-comment">-- &gt; justifyLeft 7 'x' &quot;foo&quot;    == &quot;fooxxxx&quot;</span><span>
</span><span id="line-673"></span><span class="hs-comment">-- &gt; justifyLeft 3 'x' &quot;foobar&quot; == &quot;foobar&quot;</span><span>
</span><span id="line-674"></span><span class="annot"><a href="Data.Text.Lazy.html#justifyLeft"><span class="hs-identifier hs-type">justifyLeft</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-675"></span><span id="justifyLeft"><span class="annot"><span class="annottext">justifyLeft :: Int64 -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#justifyLeft"><span class="hs-identifier hs-var hs-var">justifyLeft</span></a></span></span><span> </span><span id="local-6989586621679112726"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112726"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679112725"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112725"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112724"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112724"><span class="hs-identifier hs-var">t</span></a></span></span><span>
</span><span id="line-676"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112723"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112726"><span class="hs-identifier hs-var">k</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112724"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-677"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112724"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-operator hs-var">`append`</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-var">replicateChar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112726"><span class="hs-identifier hs-var">k</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112723"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112725"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-678"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112723"><span class="annot"><span class="annottext">len :: Int64
</span><a href="#local-6989586621679112723"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int64
</span><a href="Data.Text.Lazy.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112724"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-679"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#justifyLeft"><span class="hs-pragma hs-type">justifyLeft</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-680"></span><span>
</span><span id="line-681"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-682"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT justifyLeft -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112721"><span class="annot"><a href="#local-6989586621679112721"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679112720"><span class="annot"><a href="#local-6989586621679112720"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112719"><span class="annot"><a href="#local-6989586621679112719"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-683"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#justifyLeft"><span class="hs-pragma hs-type">justifyLeft</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112721"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112720"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112719"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#justifyLeftI"><span class="hs-pragma hs-type">S.justifyLeftI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112721"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112720"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112719"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-684"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT justifyLeft -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112717"><span class="annot"><a href="#local-6989586621679112717"><span class="hs-pragma hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679112716"><span class="annot"><a href="#local-6989586621679112716"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112715"><span class="annot"><a href="#local-6989586621679112715"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-685"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#justifyLeftI"><span class="hs-pragma hs-type">S.justifyLeftI</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112717"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112716"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112715"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#justifyLeft"><span class="hs-pragma hs-type">justifyLeft</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112717"><span class="hs-pragma hs-type">k</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112716"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112715"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-686"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-687"></span><span>
</span><span id="line-688"></span><span class="hs-comment">-- | /O(n)/ Right-justify a string to the given length, using the</span><span>
</span><span id="line-689"></span><span class="hs-comment">-- specified fill character on the left.  Performs replacement on</span><span>
</span><span id="line-690"></span><span class="hs-comment">-- invalid scalar values.</span><span>
</span><span id="line-691"></span><span class="hs-comment">--</span><span>
</span><span id="line-692"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-693"></span><span class="hs-comment">--</span><span>
</span><span id="line-694"></span><span class="hs-comment">-- &gt; justifyRight 7 'x' &quot;bar&quot;    == &quot;xxxxbar&quot;</span><span>
</span><span id="line-695"></span><span class="hs-comment">-- &gt; justifyRight 3 'x' &quot;foobar&quot; == &quot;foobar&quot;</span><span>
</span><span id="line-696"></span><span class="annot"><a href="Data.Text.Lazy.html#justifyRight"><span class="hs-identifier hs-type">justifyRight</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-697"></span><span id="justifyRight"><span class="annot"><span class="annottext">justifyRight :: Int64 -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#justifyRight"><span class="hs-identifier hs-var hs-var">justifyRight</span></a></span></span><span> </span><span id="local-6989586621679112714"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112714"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679112713"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112713"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112712"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112712"><span class="hs-identifier hs-var">t</span></a></span></span><span>
</span><span id="line-698"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112711"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112714"><span class="hs-identifier hs-var">k</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112712"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-699"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-var">replicateChar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112714"><span class="hs-identifier hs-var">k</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112711"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112713"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-operator hs-var">`append`</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112712"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-700"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112711"><span class="annot"><span class="annottext">len :: Int64
</span><a href="#local-6989586621679112711"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int64
</span><a href="Data.Text.Lazy.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112712"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-701"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#justifyRight"><span class="hs-pragma hs-type">justifyRight</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-702"></span><span>
</span><span id="line-703"></span><span class="hs-comment">-- | /O(n)/ Center a string to the given length, using the specified</span><span>
</span><span id="line-704"></span><span class="hs-comment">-- fill character on either side.  Performs replacement on invalid</span><span>
</span><span id="line-705"></span><span class="hs-comment">-- scalar values.</span><span>
</span><span id="line-706"></span><span class="hs-comment">--</span><span>
</span><span id="line-707"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-708"></span><span class="hs-comment">--</span><span>
</span><span id="line-709"></span><span class="hs-comment">-- &gt; center 8 'x' &quot;HS&quot; = &quot;xxxHSxxx&quot;</span><span>
</span><span id="line-710"></span><span class="annot"><a href="Data.Text.Lazy.html#center"><span class="hs-identifier hs-type">center</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-711"></span><span id="center"><span class="annot"><span class="annottext">center :: Int64 -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#center"><span class="hs-identifier hs-var hs-var">center</span></a></span></span><span> </span><span id="local-6989586621679112710"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112710"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679112709"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112709"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112708"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112708"><span class="hs-identifier hs-var">t</span></a></span></span><span>
</span><span id="line-712"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112707"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112710"><span class="hs-identifier hs-var">k</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112708"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-713"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-var">replicateChar</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112706"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112709"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-operator hs-var">`append`</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112708"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-operator hs-var">`append`</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-var">replicateChar</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112705"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112709"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-714"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112707"><span class="annot"><span class="annottext">len :: Int64
</span><a href="#local-6989586621679112707"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int64
</span><a href="Data.Text.Lazy.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112708"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-715"></span><span>        </span><span id="local-6989586621679112704"><span class="annot"><span class="annottext">d :: Int64
</span><a href="#local-6989586621679112704"><span class="hs-identifier hs-var hs-var">d</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112710"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112707"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-716"></span><span>        </span><span id="local-6989586621679112705"><span class="annot"><span class="annottext">r :: Int64
</span><a href="#local-6989586621679112705"><span class="hs-identifier hs-var hs-var">r</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112704"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#quot"><span class="hs-operator hs-var">`quot`</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">2</span></span><span>
</span><span id="line-717"></span><span>        </span><span id="local-6989586621679112706"><span class="annot"><span class="annottext">l :: Int64
</span><a href="#local-6989586621679112706"><span class="hs-identifier hs-var hs-var">l</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112704"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112705"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-718"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#center"><span class="hs-pragma hs-type">center</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-719"></span><span>
</span><span id="line-720"></span><span class="hs-comment">-- | /O(n)/ The 'transpose' function transposes the rows and columns</span><span>
</span><span id="line-721"></span><span class="hs-comment">-- of its 'Text' argument.  Note that this function uses 'pack',</span><span>
</span><span id="line-722"></span><span class="hs-comment">-- 'unpack', and the list version of transpose, and is thus not very</span><span>
</span><span id="line-723"></span><span class="hs-comment">-- efficient.</span><span>
</span><span id="line-724"></span><span class="annot"><a href="Data.Text.Lazy.html#transpose"><span class="hs-identifier hs-type">transpose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-725"></span><span id="transpose"><span class="annot"><span class="annottext">transpose :: [Text] -&gt; [Text]
</span><a href="Data.Text.Lazy.html#transpose"><span class="hs-identifier hs-var hs-var">transpose</span></a></span></span><span> </span><span id="local-6989586621679112703"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112703"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; Text) -&gt; [String] -&gt; [Text]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679112702"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112702"><span class="hs-identifier hs-var">ss</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Text
</span><a href="Data.Text.html#pack"><span class="hs-identifier hs-var">T.pack</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112702"><span class="hs-identifier hs-var">ss</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [[a]] -&gt; [[a]]
</span><a href="../../base/src/Data.OldList.html#transpose"><span class="hs-identifier hs-var">L.transpose</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Text -&gt; String) -&gt; [Text] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; String
</span><a href="Data.Text.Lazy.html#unpack"><span class="hs-identifier hs-var">unpack</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112703"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-727"></span><span class="hs-comment">-- TODO: make this fast</span><span>
</span><span id="line-728"></span><span>
</span><span id="line-729"></span><span class="hs-comment">-- | /O(n)/ 'reverse' @t@ returns the elements of @t@ in reverse order.</span><span>
</span><span id="line-730"></span><span class="annot"><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-type">reverse</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-735"></span><span id="reverse"><span class="annot"><span class="annottext">reverse :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var hs-var">reverse</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112699"><span class="hs-identifier hs-var">rev</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-736"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112699"><span class="annot"><span class="annottext">rev :: Text -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112699"><span class="hs-identifier hs-var hs-var">rev</span></a></span></span><span> </span><span id="local-6989586621679112698"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112698"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112698"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-737"></span><span>        </span><span class="annot"><a href="#local-6989586621679112699"><span class="hs-identifier hs-var">rev</span></a></span><span> </span><span id="local-6989586621679112697"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112697"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112696"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112696"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112695"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112695"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112699"><span class="hs-identifier hs-var">rev</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.html#reverse"><span class="hs-identifier hs-var">T.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112696"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112697"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112695"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-738"></span><span>
</span><span id="line-739"></span><span class="hs-comment">-- | /O(m+n)/ Replace every non-overlapping occurrence of @needle@ in</span><span>
</span><span id="line-740"></span><span class="hs-comment">-- @haystack@ with @replacement@.</span><span>
</span><span id="line-741"></span><span class="hs-comment">--</span><span>
</span><span id="line-742"></span><span class="hs-comment">-- This function behaves as though it was defined as follows:</span><span>
</span><span id="line-743"></span><span class="hs-comment">--</span><span>
</span><span id="line-744"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-745"></span><span class="hs-comment">-- replace needle replacement haystack =</span><span>
</span><span id="line-746"></span><span class="hs-comment">--   'intercalate' replacement ('splitOn' needle haystack)</span><span>
</span><span id="line-747"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-748"></span><span class="hs-comment">--</span><span>
</span><span id="line-749"></span><span class="hs-comment">-- As this suggests, each occurrence is replaced exactly once.  So if</span><span>
</span><span id="line-750"></span><span class="hs-comment">-- @needle@ occurs in @replacement@, that occurrence will /not/ itself</span><span>
</span><span id="line-751"></span><span class="hs-comment">-- be replaced recursively:</span><span>
</span><span id="line-752"></span><span class="hs-comment">--</span><span>
</span><span id="line-753"></span><span class="hs-comment">-- &gt; replace &quot;oo&quot; &quot;foo&quot; &quot;oo&quot; == &quot;foo&quot;</span><span>
</span><span id="line-754"></span><span class="hs-comment">--</span><span>
</span><span id="line-755"></span><span class="hs-comment">-- In cases where several instances of @needle@ overlap, only the</span><span>
</span><span id="line-756"></span><span class="hs-comment">-- first one will be replaced:</span><span>
</span><span id="line-757"></span><span class="hs-comment">--</span><span>
</span><span id="line-758"></span><span class="hs-comment">-- &gt; replace &quot;ofo&quot; &quot;bar&quot; &quot;ofofo&quot; == &quot;barfo&quot;</span><span>
</span><span id="line-759"></span><span class="hs-comment">--</span><span>
</span><span id="line-760"></span><span class="hs-comment">-- In (unlikely) bad cases, this function's time complexity degrades</span><span>
</span><span id="line-761"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-762"></span><span class="annot"><a href="Data.Text.Lazy.html#replace"><span class="hs-identifier hs-type">replace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-763"></span><span>        </span><span class="hs-comment">-- ^ @needle@ to search for.  If this string is empty, an</span><span>
</span><span id="line-764"></span><span>        </span><span class="hs-comment">-- error will occur.</span><span>
</span><span id="line-765"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-766"></span><span>        </span><span class="hs-comment">-- ^ @replacement@ to replace @needle@ with.</span><span>
</span><span id="line-767"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-768"></span><span>        </span><span class="hs-comment">-- ^ @haystack@ in which to search.</span><span>
</span><span id="line-769"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-770"></span><span id="replace"><span class="annot"><span class="annottext">replace :: Text -&gt; Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#replace"><span class="hs-identifier hs-var hs-var">replace</span></a></span></span><span> </span><span id="local-6989586621679112693"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112693"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679112692"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112692"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112692"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#splitOn"><span class="hs-identifier hs-var">splitOn</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112693"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-771"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replace"><span class="hs-pragma hs-type">replace</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-774"></span><span class="hs-comment">-- ** Case conversions (folds)</span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span class="hs-comment">-- $case</span><span>
</span><span id="line-777"></span><span class="hs-comment">--</span><span>
</span><span id="line-778"></span><span class="hs-comment">-- With Unicode text, it is incorrect to use combinators like @map</span><span>
</span><span id="line-779"></span><span class="hs-comment">-- toUpper@ to case convert each character of a string individually.</span><span>
</span><span id="line-780"></span><span class="hs-comment">-- Instead, use the whole-string case conversion functions from this</span><span>
</span><span id="line-781"></span><span class="hs-comment">-- module.  For correctness in different writing systems, these</span><span>
</span><span id="line-782"></span><span class="hs-comment">-- functions may map one input character to two or three output</span><span>
</span><span id="line-783"></span><span class="hs-comment">-- characters.</span><span>
</span><span id="line-784"></span><span>
</span><span id="line-785"></span><span class="hs-comment">-- | /O(n)/ Convert a string to folded case.  Subject to fusion.</span><span>
</span><span id="line-786"></span><span class="hs-comment">--</span><span>
</span><span id="line-787"></span><span class="hs-comment">-- This function is mainly useful for performing caseless (or case</span><span>
</span><span id="line-788"></span><span class="hs-comment">-- insensitive) string comparisons.</span><span>
</span><span id="line-789"></span><span class="hs-comment">--</span><span>
</span><span id="line-790"></span><span class="hs-comment">-- A string @x@ is a caseless match for a string @y@ if and only if:</span><span>
</span><span id="line-791"></span><span class="hs-comment">--</span><span>
</span><span id="line-792"></span><span class="hs-comment">-- @toCaseFold x == toCaseFold y@</span><span>
</span><span id="line-793"></span><span class="hs-comment">--</span><span>
</span><span id="line-794"></span><span class="hs-comment">-- The result string may be longer than the input string, and may</span><span>
</span><span id="line-795"></span><span class="hs-comment">-- differ from applying 'toLower' to the input string.  For instance,</span><span>
</span><span id="line-796"></span><span class="hs-comment">-- the Armenian small ligature men now (U+FB13) is case folded to the</span><span>
</span><span id="line-797"></span><span class="hs-comment">-- bigram men now (U+0574 U+0576), while the micro sign (U+00B5) is</span><span>
</span><span id="line-798"></span><span class="hs-comment">-- case folded to the Greek small letter letter mu (U+03BC) instead of</span><span>
</span><span id="line-799"></span><span class="hs-comment">-- itself.</span><span>
</span><span id="line-800"></span><span class="annot"><a href="Data.Text.Lazy.html#toCaseFold"><span class="hs-identifier hs-type">toCaseFold</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-801"></span><span id="toCaseFold"><span class="annot"><span class="annottext">toCaseFold :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#toCaseFold"><span class="hs-identifier hs-var hs-var">toCaseFold</span></a></span></span><span> </span><span id="local-6989586621679112691"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112691"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#toCaseFold"><span class="hs-identifier hs-var">S.toCaseFold</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112691"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-802"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toCaseFold"><span class="hs-pragma hs-type">toCaseFold</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-803"></span><span>
</span><span id="line-804"></span><span class="hs-comment">-- | /O(n)/ Convert a string to lower case, using simple case</span><span>
</span><span id="line-805"></span><span class="hs-comment">-- conversion.  Subject to fusion.</span><span>
</span><span id="line-806"></span><span class="hs-comment">--</span><span>
</span><span id="line-807"></span><span class="hs-comment">-- The result string may be longer than the input string.  For</span><span>
</span><span id="line-808"></span><span class="hs-comment">-- instance, the Latin capital letter I with dot above (U+0130) maps</span><span>
</span><span id="line-809"></span><span class="hs-comment">-- to the sequence Latin small letter i (U+0069) followed by combining</span><span>
</span><span id="line-810"></span><span class="hs-comment">-- dot above (U+0307).</span><span>
</span><span id="line-811"></span><span class="annot"><a href="Data.Text.Lazy.html#toLower"><span class="hs-identifier hs-type">toLower</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-812"></span><span id="toLower"><span class="annot"><span class="annottext">toLower :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#toLower"><span class="hs-identifier hs-var hs-var">toLower</span></a></span></span><span> </span><span id="local-6989586621679112689"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112689"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#toLower"><span class="hs-identifier hs-var">S.toLower</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112689"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-813"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toLower"><span class="hs-pragma hs-type">toLower</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-814"></span><span>
</span><span id="line-815"></span><span class="hs-comment">-- | /O(n)/ Convert a string to upper case, using simple case</span><span>
</span><span id="line-816"></span><span class="hs-comment">-- conversion.  Subject to fusion.</span><span>
</span><span id="line-817"></span><span class="hs-comment">--</span><span>
</span><span id="line-818"></span><span class="hs-comment">-- The result string may be longer than the input string.  For</span><span>
</span><span id="line-819"></span><span class="hs-comment">-- instance, the German eszett (U+00DF) maps to the two-letter</span><span>
</span><span id="line-820"></span><span class="hs-comment">-- sequence SS.</span><span>
</span><span id="line-821"></span><span class="annot"><a href="Data.Text.Lazy.html#toUpper"><span class="hs-identifier hs-type">toUpper</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-822"></span><span id="toUpper"><span class="annot"><span class="annottext">toUpper :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#toUpper"><span class="hs-identifier hs-var hs-var">toUpper</span></a></span></span><span> </span><span id="local-6989586621679112687"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112687"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#toUpper"><span class="hs-identifier hs-var">S.toUpper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112687"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-823"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toUpper"><span class="hs-pragma hs-type">toUpper</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span>
</span><span id="line-826"></span><span class="hs-comment">-- | /O(n)/ Convert a string to title case, using simple case</span><span>
</span><span id="line-827"></span><span class="hs-comment">-- conversion.  Subject to fusion.</span><span>
</span><span id="line-828"></span><span class="hs-comment">--</span><span>
</span><span id="line-829"></span><span class="hs-comment">-- The first letter of the input is converted to title case, as is</span><span>
</span><span id="line-830"></span><span class="hs-comment">-- every subsequent letter that immediately follows a non-letter.</span><span>
</span><span id="line-831"></span><span class="hs-comment">-- Every letter that immediately follows another letter is converted</span><span>
</span><span id="line-832"></span><span class="hs-comment">-- to lower case.</span><span>
</span><span id="line-833"></span><span class="hs-comment">--</span><span>
</span><span id="line-834"></span><span class="hs-comment">-- The result string may be longer than the input string. For example,</span><span>
</span><span id="line-835"></span><span class="hs-comment">-- the Latin small ligature &amp;#xfb02; (U+FB02) is converted to the</span><span>
</span><span id="line-836"></span><span class="hs-comment">-- sequence Latin capital letter F (U+0046) followed by Latin small</span><span>
</span><span id="line-837"></span><span class="hs-comment">-- letter l (U+006C).</span><span>
</span><span id="line-838"></span><span class="hs-comment">--</span><span>
</span><span id="line-839"></span><span class="hs-comment">-- /Note/: this function does not take language or culture specific</span><span>
</span><span id="line-840"></span><span class="hs-comment">-- rules into account. For instance, in English, different style</span><span>
</span><span id="line-841"></span><span class="hs-comment">-- guides disagree on whether the book name \&quot;The Hill of the Red</span><span>
</span><span id="line-842"></span><span class="hs-comment">-- Fox\&quot; is correctly title cased&amp;#x2014;but this function will</span><span>
</span><span id="line-843"></span><span class="hs-comment">-- capitalize /every/ word.</span><span>
</span><span id="line-844"></span><span class="hs-comment">--</span><span>
</span><span id="line-845"></span><span class="hs-comment">-- @since 1.0.0.0</span><span>
</span><span id="line-846"></span><span class="annot"><a href="Data.Text.Lazy.html#toTitle"><span class="hs-identifier hs-type">toTitle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-847"></span><span id="toTitle"><span class="annot"><span class="annottext">toTitle :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#toTitle"><span class="hs-identifier hs-var hs-var">toTitle</span></a></span></span><span> </span><span id="local-6989586621679112685"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112685"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#toTitle"><span class="hs-identifier hs-var">S.toTitle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112685"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-848"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#toTitle"><span class="hs-pragma hs-type">toTitle</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-849"></span><span>
</span><span id="line-850"></span><span class="hs-comment">-- | /O(n)/ 'foldl', applied to a binary operator, a starting value</span><span>
</span><span id="line-851"></span><span class="hs-comment">-- (typically the left-identity of the operator), and a 'Text',</span><span>
</span><span id="line-852"></span><span class="hs-comment">-- reduces the 'Text' using the binary operator, from left to right.</span><span>
</span><span id="line-853"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-854"></span><span id="local-6989586621679113396"><span class="annot"><a href="Data.Text.Lazy.html#foldl"><span class="hs-identifier hs-type">foldl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679113396"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113396"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113396"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113396"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-855"></span><span id="foldl"><span class="annot"><span class="annottext">foldl :: forall a. (a -&gt; Char -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Lazy.html#foldl"><span class="hs-identifier hs-var hs-var">foldl</span></a></span></span><span> </span><span id="local-6989586621679112683"><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679112683"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112682"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112682"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679112681"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112681"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Char -&gt; a) -&gt; a -&gt; Stream Char -&gt; a
forall b. (b -&gt; Char -&gt; b) -&gt; b -&gt; Stream Char -&gt; b
</span><a href="Data.Text.Internal.Fusion.Common.html#foldl"><span class="hs-identifier hs-var">S.foldl</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679112683"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112682"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112681"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-856"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl"><span class="hs-pragma hs-type">foldl</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-857"></span><span>
</span><span id="line-858"></span><span class="hs-comment">-- | /O(n)/ A strict version of 'foldl'.</span><span>
</span><span id="line-859"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-860"></span><span id="local-6989586621679112679"><span class="annot"><a href="Data.Text.Lazy.html#foldl%27"><span class="hs-identifier hs-type">foldl'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679112679"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679112679"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679112679"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679112679"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-861"></span><span id="foldl%27"><span class="annot"><span class="annottext">foldl' :: forall a. (a -&gt; Char -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Lazy.html#foldl%27"><span class="hs-identifier hs-var hs-var">foldl'</span></a></span></span><span> </span><span id="local-6989586621679112678"><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679112678"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112677"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112677"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679112676"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112676"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Char -&gt; a) -&gt; a -&gt; Stream Char -&gt; a
forall b. (b -&gt; Char -&gt; b) -&gt; b -&gt; Stream Char -&gt; b
</span><a href="Data.Text.Internal.Fusion.Common.html#foldl%27"><span class="hs-identifier hs-var">S.foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Char -&gt; a
</span><a href="#local-6989586621679112678"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112677"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112676"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-862"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl%27"><span class="hs-pragma hs-type">foldl'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-863"></span><span>
</span><span id="line-864"></span><span class="hs-comment">-- | /O(n)/ A variant of 'foldl' that has no starting value argument,</span><span>
</span><span id="line-865"></span><span class="hs-comment">-- and thus must be applied to a non-empty 'Text'.  Subject to fusion.</span><span>
</span><span id="line-866"></span><span class="annot"><a href="Data.Text.Lazy.html#foldl1"><span class="hs-identifier hs-type">foldl1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-867"></span><span id="foldl1"><span class="annot"><span class="annottext">foldl1 :: (Char -&gt; Char -&gt; Char) -&gt; Text -&gt; Char
</span><a href="Data.Text.Lazy.html#foldl1"><span class="hs-identifier hs-var hs-var">foldl1</span></a></span></span><span> </span><span id="local-6989586621679112674"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112674"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112673"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112673"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Stream Char -&gt; Char
</span><a href="Data.Text.Internal.Fusion.Common.html#foldl1"><span class="hs-identifier hs-var">S.foldl1</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112674"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112673"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-868"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl1"><span class="hs-pragma hs-type">foldl1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-869"></span><span>
</span><span id="line-870"></span><span class="hs-comment">-- | /O(n)/ A strict version of 'foldl1'.  Subject to fusion.</span><span>
</span><span id="line-871"></span><span class="annot"><a href="Data.Text.Lazy.html#foldl1%27"><span class="hs-identifier hs-type">foldl1'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-872"></span><span id="foldl1%27"><span class="annot"><span class="annottext">foldl1' :: (Char -&gt; Char -&gt; Char) -&gt; Text -&gt; Char
</span><a href="Data.Text.Lazy.html#foldl1%27"><span class="hs-identifier hs-var hs-var">foldl1'</span></a></span></span><span> </span><span id="local-6989586621679112671"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112671"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112670"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112670"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Stream Char -&gt; Char
</span><a href="Data.Text.Internal.Fusion.Common.html#foldl1%27"><span class="hs-identifier hs-var">S.foldl1'</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112671"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112670"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-873"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldl1%27"><span class="hs-pragma hs-type">foldl1'</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-874"></span><span>
</span><span id="line-875"></span><span class="hs-comment">-- | /O(n)/ 'foldr', applied to a binary operator, a starting value</span><span>
</span><span id="line-876"></span><span class="hs-comment">-- (typically the right-identity of the operator), and a 'Text',</span><span>
</span><span id="line-877"></span><span class="hs-comment">-- reduces the 'Text' using the binary operator, from right to left.</span><span>
</span><span id="line-878"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-879"></span><span id="local-6989586621679113392"><span class="annot"><a href="Data.Text.Lazy.html#foldr"><span class="hs-identifier hs-type">foldr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113392"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113392"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113392"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113392"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-880"></span><span id="foldr"><span class="annot"><span class="annottext">foldr :: forall a. (Char -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Lazy.html#foldr"><span class="hs-identifier hs-var hs-var">foldr</span></a></span></span><span> </span><span id="local-6989586621679112668"><span class="annot"><span class="annottext">Char -&gt; a -&gt; a
</span><a href="#local-6989586621679112668"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112667"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112667"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679112666"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112666"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; a -&gt; a) -&gt; a -&gt; Stream Char -&gt; a
forall b. (Char -&gt; b -&gt; b) -&gt; b -&gt; Stream Char -&gt; b
</span><a href="Data.Text.Internal.Fusion.Common.html#foldr"><span class="hs-identifier hs-var">S.foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; a -&gt; a
</span><a href="#local-6989586621679112668"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112667"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112666"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-881"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-882"></span><span>
</span><span id="line-883"></span><span class="hs-comment">-- | /O(n)/ A variant of 'foldr' that has no starting value argument,</span><span>
</span><span id="line-884"></span><span class="hs-comment">-- and thus must be applied to a non-empty 'Text'.  Subject to</span><span>
</span><span id="line-885"></span><span class="hs-comment">-- fusion.</span><span>
</span><span id="line-886"></span><span class="annot"><a href="Data.Text.Lazy.html#foldr1"><span class="hs-identifier hs-type">foldr1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-887"></span><span id="foldr1"><span class="annot"><span class="annottext">foldr1 :: (Char -&gt; Char -&gt; Char) -&gt; Text -&gt; Char
</span><a href="Data.Text.Lazy.html#foldr1"><span class="hs-identifier hs-var hs-var">foldr1</span></a></span></span><span> </span><span id="local-6989586621679112664"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112664"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112663"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112663"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Stream Char -&gt; Char
</span><a href="Data.Text.Internal.Fusion.Common.html#foldr1"><span class="hs-identifier hs-var">S.foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112664"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112663"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-888"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#foldr1"><span class="hs-pragma hs-type">foldr1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-889"></span><span>
</span><span id="line-890"></span><span class="hs-comment">-- | /O(n)/ Concatenate a list of 'Text's.</span><span>
</span><span id="line-891"></span><span class="annot"><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-type">concat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-892"></span><span id="concat"><span class="annot"><span class="annottext">concat :: [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-var hs-var">concat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="#local-6989586621679112661"><span class="hs-identifier hs-var">to</span></a></span><span>
</span><span id="line-893"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-894"></span><span>    </span><span id="local-6989586621679112660"><span class="annot"><span class="annottext">go :: Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112660"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span id="local-6989586621679112659"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112659"><span class="hs-identifier hs-var">css</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="#local-6989586621679112661"><span class="hs-identifier hs-var">to</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112659"><span class="hs-identifier hs-var">css</span></a></span><span>
</span><span id="line-895"></span><span>    </span><span class="annot"><a href="#local-6989586621679112660"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112658"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112658"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112657"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112657"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112656"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112656"><span class="hs-identifier hs-var">css</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112658"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112660"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112657"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112656"><span class="hs-identifier hs-var">css</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-896"></span><span>    </span><span id="local-6989586621679112661"><span class="annot"><span class="annottext">to :: [Text] -&gt; Text
</span><a href="#local-6989586621679112661"><span class="hs-identifier hs-var hs-var">to</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-897"></span><span>    </span><span class="annot"><a href="#local-6989586621679112661"><span class="hs-identifier hs-var">to</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112655"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112655"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112654"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112654"><span class="hs-identifier hs-var">css</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112660"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112655"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112654"><span class="hs-identifier hs-var">css</span></a></span><span>
</span><span id="line-898"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#concat"><span class="hs-pragma hs-type">concat</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-899"></span><span>
</span><span id="line-900"></span><span class="hs-comment">-- | /O(n)/ Map a function over a 'Text' that results in a 'Text', and</span><span>
</span><span id="line-901"></span><span class="hs-comment">-- concatenate the results.</span><span>
</span><span id="line-902"></span><span class="annot"><a href="Data.Text.Lazy.html#concatMap"><span class="hs-identifier hs-type">concatMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-903"></span><span id="concatMap"><span class="annot"><span class="annottext">concatMap :: (Char -&gt; Text) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#concatMap"><span class="hs-identifier hs-var hs-var">concatMap</span></a></span></span><span> </span><span id="local-6989586621679112653"><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="#local-6989586621679112653"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; [Text] -&gt; [Text]) -&gt; [Text] -&gt; Text -&gt; [Text]
forall a. (Char -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Lazy.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; [Text] -&gt; [Text])
-&gt; (Char -&gt; Text) -&gt; Char -&gt; [Text] -&gt; [Text]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="#local-6989586621679112653"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-904"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#concatMap"><span class="hs-pragma hs-type">concatMap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-905"></span><span>
</span><span id="line-906"></span><span class="hs-comment">-- | /O(n)/ 'any' @p@ @t@ determines whether any character in the</span><span>
</span><span id="line-907"></span><span class="hs-comment">-- 'Text' @t@ satisfies the predicate @p@. Subject to fusion.</span><span>
</span><span id="line-908"></span><span class="annot"><a href="Data.Text.Lazy.html#any"><span class="hs-identifier hs-type">any</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-909"></span><span id="any"><span class="annot"><span class="annottext">any :: (Char -&gt; Bool) -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#any"><span class="hs-identifier hs-var hs-var">any</span></a></span></span><span> </span><span id="local-6989586621679112652"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112652"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112651"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112651"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Stream Char -&gt; Bool
</span><a href="Data.Text.Internal.Fusion.Common.html#any"><span class="hs-identifier hs-var">S.any</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112652"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112651"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-910"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#any"><span class="hs-pragma hs-type">any</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-911"></span><span>
</span><span id="line-912"></span><span class="hs-comment">-- | /O(n)/ 'all' @p@ @t@ determines whether all characters in the</span><span>
</span><span id="line-913"></span><span class="hs-comment">-- 'Text' @t@ satisfy the predicate @p@. Subject to fusion.</span><span>
</span><span id="line-914"></span><span class="annot"><a href="Data.Text.Lazy.html#all"><span class="hs-identifier hs-type">all</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-915"></span><span id="all"><span class="annot"><span class="annottext">all :: (Char -&gt; Bool) -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#all"><span class="hs-identifier hs-var hs-var">all</span></a></span></span><span> </span><span id="local-6989586621679112649"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112649"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112648"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112648"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Stream Char -&gt; Bool
</span><a href="Data.Text.Internal.Fusion.Common.html#all"><span class="hs-identifier hs-var">S.all</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112649"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112648"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-916"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#all"><span class="hs-pragma hs-type">all</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-917"></span><span>
</span><span id="line-918"></span><span class="hs-comment">-- | /O(n)/ 'maximum' returns the maximum value from a 'Text', which</span><span>
</span><span id="line-919"></span><span class="hs-comment">-- must be non-empty. Subject to fusion.</span><span>
</span><span id="line-920"></span><span class="annot"><a href="Data.Text.Lazy.html#maximum"><span class="hs-identifier hs-type">maximum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-921"></span><span id="maximum"><span class="annot"><span class="annottext">maximum :: Text -&gt; Char
</span><a href="Data.Text.Lazy.html#maximum"><span class="hs-identifier hs-var hs-var">maximum</span></a></span></span><span> </span><span id="local-6989586621679112646"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112646"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Char
</span><a href="Data.Text.Internal.Fusion.Common.html#maximum"><span class="hs-identifier hs-var">S.maximum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112646"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-922"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#maximum"><span class="hs-pragma hs-type">maximum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-923"></span><span>
</span><span id="line-924"></span><span class="hs-comment">-- | /O(n)/ 'minimum' returns the minimum value from a 'Text', which</span><span>
</span><span id="line-925"></span><span class="hs-comment">-- must be non-empty. Subject to fusion.</span><span>
</span><span id="line-926"></span><span class="annot"><a href="Data.Text.Lazy.html#minimum"><span class="hs-identifier hs-type">minimum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-927"></span><span id="minimum"><span class="annot"><span class="annottext">minimum :: Text -&gt; Char
</span><a href="Data.Text.Lazy.html#minimum"><span class="hs-identifier hs-var hs-var">minimum</span></a></span></span><span> </span><span id="local-6989586621679112644"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112644"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Char
</span><a href="Data.Text.Internal.Fusion.Common.html#minimum"><span class="hs-identifier hs-var">S.minimum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112644"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-928"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#minimum"><span class="hs-pragma hs-type">minimum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-929"></span><span>
</span><span id="line-930"></span><span class="hs-comment">-- | /O(n)/ 'scanl' is similar to 'foldl', but returns a list of</span><span>
</span><span id="line-931"></span><span class="hs-comment">-- successive reduced values from the left. Subject to fusion.</span><span>
</span><span id="line-932"></span><span class="hs-comment">-- Performs replacement on invalid scalar values.</span><span>
</span><span id="line-933"></span><span class="hs-comment">--</span><span>
</span><span id="line-934"></span><span class="hs-comment">-- &gt; scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]</span><span>
</span><span id="line-935"></span><span class="hs-comment">--</span><span>
</span><span id="line-936"></span><span class="hs-comment">-- Note that</span><span>
</span><span id="line-937"></span><span class="hs-comment">--</span><span>
</span><span id="line-938"></span><span class="hs-comment">-- &gt; last (scanl f z xs) == foldl f z xs.</span><span>
</span><span id="line-939"></span><span class="annot"><a href="Data.Text.Lazy.html#scanl"><span class="hs-identifier hs-type">scanl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-940"></span><span id="scanl"><span class="annot"><span class="annottext">scanl :: (Char -&gt; Char -&gt; Char) -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanl"><span class="hs-identifier hs-var hs-var">scanl</span></a></span></span><span> </span><span id="local-6989586621679112642"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112642"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112641"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112641"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span id="local-6989586621679112640"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112640"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Char -&gt; Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#scanl"><span class="hs-identifier hs-var">S.scanl</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112638"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112641"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112640"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-941"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112638"><span class="annot"><span class="annottext">g :: Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112638"><span class="hs-identifier hs-var hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679112637"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112637"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679112636"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112636"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112642"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112637"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112636"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-942"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#scanl"><span class="hs-pragma hs-type">scanl</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-943"></span><span>
</span><span id="line-944"></span><span class="hs-comment">-- | /O(n)/ 'scanl1' is a variant of 'scanl' that has no starting</span><span>
</span><span id="line-945"></span><span class="hs-comment">-- value argument.  Performs replacement on invalid scalar values.</span><span>
</span><span id="line-946"></span><span class="hs-comment">--</span><span>
</span><span id="line-947"></span><span class="hs-comment">-- &gt; scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]</span><span>
</span><span id="line-948"></span><span class="annot"><a href="Data.Text.Lazy.html#scanl1"><span class="hs-identifier hs-type">scanl1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-949"></span><span id="scanl1"><span class="annot"><span class="annottext">scanl1 :: (Char -&gt; Char -&gt; Char) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanl1"><span class="hs-identifier hs-var hs-var">scanl1</span></a></span></span><span> </span><span id="local-6989586621679112635"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112635"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112634"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112634"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Maybe (Char, Text)
</span><a href="Data.Text.Lazy.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112634"><span class="hs-identifier hs-var">t0</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-950"></span><span>                </span><span class="annot"><span class="annottext">Maybe (Char, Text)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-951"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112633"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112633"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112632"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112632"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanl"><span class="hs-identifier hs-var">scanl</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112635"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112633"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112632"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-952"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#scanl1"><span class="hs-pragma hs-type">scanl1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-953"></span><span>
</span><span id="line-954"></span><span class="hs-comment">-- | /O(n)/ 'scanr' is the right-to-left dual of 'scanl'.  Performs</span><span>
</span><span id="line-955"></span><span class="hs-comment">-- replacement on invalid scalar values.</span><span>
</span><span id="line-956"></span><span class="hs-comment">--</span><span>
</span><span id="line-957"></span><span class="hs-comment">-- &gt; scanr f v == reverse . scanl (flip f) v . reverse</span><span>
</span><span id="line-958"></span><span class="annot"><a href="Data.Text.Lazy.html#scanr"><span class="hs-identifier hs-type">scanr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-959"></span><span id="scanr"><span class="annot"><span class="annottext">scanr :: (Char -&gt; Char -&gt; Char) -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanr"><span class="hs-identifier hs-var hs-var">scanr</span></a></span></span><span> </span><span id="local-6989586621679112631"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112631"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112630"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112630"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; (Text -&gt; Text) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanl"><span class="hs-identifier hs-var">scanl</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112629"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112630"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; (Text -&gt; Text) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span>
</span><span id="line-960"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112629"><span class="annot"><span class="annottext">g :: Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112629"><span class="hs-identifier hs-var hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679112628"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112628"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679112627"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112627"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112631"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112627"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112628"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-961"></span><span>
</span><span id="line-962"></span><span class="hs-comment">-- | /O(n)/ 'scanr1' is a variant of 'scanr' that has no starting</span><span>
</span><span id="line-963"></span><span class="hs-comment">-- value argument.  Performs replacement on invalid scalar values.</span><span>
</span><span id="line-964"></span><span class="annot"><a href="Data.Text.Lazy.html#scanr1"><span class="hs-identifier hs-type">scanr1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-965"></span><span id="scanr1"><span class="annot"><span class="annottext">scanr1 :: (Char -&gt; Char -&gt; Char) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanr1"><span class="hs-identifier hs-var hs-var">scanr1</span></a></span></span><span> </span><span id="local-6989586621679112626"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112626"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112625"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112625"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112625"><span class="hs-identifier hs-var">t</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-966"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#scanr"><span class="hs-identifier hs-var">scanr</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112626"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Lazy.html#last"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112625"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#init"><span class="hs-identifier hs-var">init</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112625"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-967"></span><span>
</span><span id="line-968"></span><span class="hs-comment">-- | /O(n)/ Like a combination of 'map' and 'foldl''. Applies a</span><span>
</span><span id="line-969"></span><span class="hs-comment">-- function to each element of a 'Text', passing an accumulating</span><span>
</span><span id="line-970"></span><span class="hs-comment">-- parameter from left to right, and returns a final 'Text'.  Performs</span><span>
</span><span id="line-971"></span><span class="hs-comment">-- replacement on invalid scalar values.</span><span>
</span><span id="line-972"></span><span id="local-6989586621679113389"><span class="annot"><a href="Data.Text.Lazy.html#mapAccumL"><span class="hs-identifier hs-type">mapAccumL</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679113389"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679113389"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113389"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679113389"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-973"></span><span id="mapAccumL"><span class="annot"><span class="annottext">mapAccumL :: forall a. (a -&gt; Char -&gt; (a, Char)) -&gt; a -&gt; Text -&gt; (a, Text)
</span><a href="Data.Text.Lazy.html#mapAccumL"><span class="hs-identifier hs-var hs-var">mapAccumL</span></a></span></span><span> </span><span id="local-6989586621679112624"><span class="annot"><span class="annottext">a -&gt; Char -&gt; (a, Char)
</span><a href="#local-6989586621679112624"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Text -&gt; (a, Text)
</span><a href="#local-6989586621679112623"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-974"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-975"></span><span>    </span><span id="local-6989586621679112623"><span class="annot"><span class="annottext">go :: a -&gt; Text -&gt; (a, Text)
</span><a href="#local-6989586621679112623"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112622"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112622"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112621"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112621"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112620"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112620"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112619"><span class="hs-identifier hs-var">z''</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112618"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112617"><span class="hs-identifier hs-var">cs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-976"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112616"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112616"><span class="hs-identifier hs-var">z'</span></a></span></span><span class="hs-special">,</span><span>  </span><span id="local-6989586621679112618"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112618"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Char -&gt; (a, Char)) -&gt; a -&gt; Text -&gt; (a, Text)
forall a. (a -&gt; Char -&gt; (a, Char)) -&gt; a -&gt; Text -&gt; (a, Text)
</span><a href="Data.Text.html#mapAccumL"><span class="hs-identifier hs-var">T.mapAccumL</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Char -&gt; (a, Char)
</span><a href="#local-6989586621679112624"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112622"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112621"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-977"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621679112619"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112619"><span class="hs-identifier hs-var">z''</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679112617"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112617"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Text -&gt; (a, Text)
</span><a href="#local-6989586621679112623"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112616"><span class="hs-identifier hs-var">z'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112620"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-978"></span><span>    </span><span class="annot"><a href="#local-6989586621679112623"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679112614"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112614"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112614"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-979"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#mapAccumL"><span class="hs-pragma hs-type">mapAccumL</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-980"></span><span>
</span><span id="line-981"></span><span class="hs-comment">-- | The 'mapAccumR' function behaves like a combination of 'map' and</span><span>
</span><span id="line-982"></span><span class="hs-comment">-- a strict 'foldr'; it applies a function to each element of a</span><span>
</span><span id="line-983"></span><span class="hs-comment">-- 'Text', passing an accumulating parameter from right to left, and</span><span>
</span><span id="line-984"></span><span class="hs-comment">-- returning a final value of this accumulator together with the new</span><span>
</span><span id="line-985"></span><span class="hs-comment">-- 'Text'.  Performs replacement on invalid scalar values.</span><span>
</span><span id="line-986"></span><span id="local-6989586621679112613"><span class="annot"><a href="Data.Text.Lazy.html#mapAccumR"><span class="hs-identifier hs-type">mapAccumR</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679112613"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679112613"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679112613"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679112613"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-987"></span><span id="mapAccumR"><span class="annot"><span class="annottext">mapAccumR :: forall a. (a -&gt; Char -&gt; (a, Char)) -&gt; a -&gt; Text -&gt; (a, Text)
</span><a href="Data.Text.Lazy.html#mapAccumR"><span class="hs-identifier hs-var hs-var">mapAccumR</span></a></span></span><span> </span><span id="local-6989586621679112612"><span class="annot"><span class="annottext">a -&gt; Char -&gt; (a, Char)
</span><a href="#local-6989586621679112612"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Text -&gt; (a, Text)
</span><a href="#local-6989586621679112611"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-988"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-989"></span><span>    </span><span id="local-6989586621679112611"><span class="annot"><span class="annottext">go :: a -&gt; Text -&gt; (a, Text)
</span><a href="#local-6989586621679112611"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112610"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112610"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112609"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112609"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112608"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112608"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112607"><span class="hs-identifier hs-var">z''</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112606"><span class="hs-identifier hs-var">c'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112605"><span class="hs-identifier hs-var">cs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-990"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112607"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112607"><span class="hs-identifier hs-var">z''</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679112606"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112606"><span class="hs-identifier hs-var">c'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; Char -&gt; (a, Char)) -&gt; a -&gt; Text -&gt; (a, Text)
forall a. (a -&gt; Char -&gt; (a, Char)) -&gt; a -&gt; Text -&gt; (a, Text)
</span><a href="Data.Text.html#mapAccumR"><span class="hs-identifier hs-var">T.mapAccumR</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Char -&gt; (a, Char)
</span><a href="#local-6989586621679112612"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112603"><span class="hs-identifier hs-var">z'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112609"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-991"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621679112603"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112603"><span class="hs-identifier hs-var">z'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679112605"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112605"><span class="hs-identifier hs-var">cs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Text -&gt; (a, Text)
</span><a href="#local-6989586621679112611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112610"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112608"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-992"></span><span>    </span><span class="annot"><a href="#local-6989586621679112611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679112602"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112602"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112602"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-993"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#mapAccumR"><span class="hs-pragma hs-type">mapAccumR</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-994"></span><span>
</span><span id="line-995"></span><span class="hs-comment">-- | @'repeat' x@ is an infinite 'Text', with @x@ the value of every</span><span>
</span><span id="line-996"></span><span class="hs-comment">-- element.</span><span>
</span><span id="line-997"></span><span class="hs-comment">--</span><span>
</span><span id="line-998"></span><span class="hs-comment">-- @since 1.2.0.5</span><span>
</span><span id="line-999"></span><span class="annot"><a href="Data.Text.Lazy.html#repeat"><span class="hs-identifier hs-type">repeat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1000"></span><span id="repeat"><span class="annot"><span class="annottext">repeat :: Char -&gt; Text
</span><a href="Data.Text.Lazy.html#repeat"><span class="hs-identifier hs-var hs-var">repeat</span></a></span></span><span> </span><span id="local-6989586621679112601"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112601"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112600"><span class="annot"><span class="annottext">t :: Text
</span><a href="#local-6989586621679112600"><span class="hs-identifier hs-var hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#replicate"><span class="hs-identifier hs-var">T.replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="Data.Text.Internal.Lazy.html#smallChunkSize"><span class="hs-identifier hs-var">smallChunkSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="Data.Text.Show.html#singleton"><span class="hs-identifier hs-var">T.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112601"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112600"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1001"></span><span>            </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112600"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1002"></span><span>
</span><span id="line-1003"></span><span class="hs-comment">-- | /O(n*m)/ 'replicate' @n@ @t@ is a 'Text' consisting of the input</span><span>
</span><span id="line-1004"></span><span class="hs-comment">-- @t@ repeated @n@ times.</span><span>
</span><span id="line-1005"></span><span class="annot"><a href="Data.Text.Lazy.html#replicate"><span class="hs-identifier hs-type">replicate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1006"></span><span id="replicate"><span class="annot"><span class="annottext">replicate :: Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#replicate"><span class="hs-identifier hs-var hs-var">replicate</span></a></span></span><span> </span><span id="local-6989586621679112598"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112598"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112597"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112597"><span class="hs-identifier hs-var">t</span></a></span></span><span>
</span><span id="line-1007"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112597"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112598"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-1008"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isSingleton"><span class="hs-identifier hs-var">isSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112597"><span class="hs-identifier hs-var">t</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-var">replicateChar</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112598"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Lazy.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112597"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1009"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; [Text]
</span><a href="#local-6989586621679112595"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span>
</span><span id="line-1010"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112595"><span class="annot"><span class="annottext">rep :: Int64 -&gt; [Text]
</span><a href="#local-6989586621679112595"><span class="hs-identifier hs-var hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679112594"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112594"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112594"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112598"><span class="hs-identifier hs-var">n</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1011"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112597"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; [Text]
</span><a href="#local-6989586621679112595"><span class="hs-identifier hs-var">rep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112594"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-1012"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replicate"><span class="hs-pragma hs-type">replicate</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1013"></span><span>
</span><span id="line-1014"></span><span class="hs-comment">-- | 'cycle' ties a finite, non-empty 'Text' into a circular one, or</span><span>
</span><span id="line-1015"></span><span class="hs-comment">-- equivalently, the infinite repetition of the original 'Text'.</span><span>
</span><span id="line-1016"></span><span class="hs-comment">--</span><span>
</span><span id="line-1017"></span><span class="hs-comment">-- @since 1.2.0.5</span><span>
</span><span id="line-1018"></span><span class="annot"><a href="Data.Text.Lazy.html#cycle"><span class="hs-identifier hs-type">cycle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1019"></span><span id="cycle"><span class="annot"><span class="annottext">cycle :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#cycle"><span class="hs-identifier hs-var hs-var">cycle</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cycle&quot;</span></span><span>
</span><span id="line-1020"></span><span class="annot"><a href="Data.Text.Lazy.html#cycle"><span class="hs-identifier hs-var">cycle</span></a></span><span> </span><span id="local-6989586621679112593"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112593"><span class="hs-identifier hs-var">t</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112592"><span class="annot"><span class="annottext">t' :: Text
</span><a href="#local-6989586621679112592"><span class="hs-identifier hs-var hs-var">t'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text) -&gt; Text -&gt; Text -&gt; Text
forall a. (Text -&gt; a -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldrChunks"><span class="hs-identifier hs-var">foldrChunks</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112592"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112593"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1021"></span><span>               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112592"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-1022"></span><span>
</span><span id="line-1023"></span><span class="hs-comment">-- | @'iterate' f x@ returns an infinite 'Text' of repeated applications</span><span>
</span><span id="line-1024"></span><span class="hs-comment">-- of @f@ to @x@:</span><span>
</span><span id="line-1025"></span><span class="hs-comment">--</span><span>
</span><span id="line-1026"></span><span class="hs-comment">-- &gt; iterate f x == [x, f x, f (f x), ...]</span><span>
</span><span id="line-1027"></span><span class="hs-comment">--</span><span>
</span><span id="line-1028"></span><span class="hs-comment">-- @since 1.2.0.5</span><span>
</span><span id="line-1029"></span><span class="annot"><a href="Data.Text.Lazy.html#iterate"><span class="hs-identifier hs-type">iterate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1030"></span><span id="iterate"><span class="annot"><span class="annottext">iterate :: (Char -&gt; Char) -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#iterate"><span class="hs-identifier hs-var hs-var">iterate</span></a></span></span><span> </span><span id="local-6989586621679112591"><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679112591"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112590"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112590"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112589"><span class="annot"><span class="annottext">t :: Char -&gt; Text
</span><a href="#local-6989586621679112589"><span class="hs-identifier hs-var hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112588"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112588"><span class="hs-identifier hs-var">c'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="Data.Text.Show.html#singleton"><span class="hs-identifier hs-var">T.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112588"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="#local-6989586621679112589"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="#local-6989586621679112591"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112588"><span class="hs-identifier hs-var">c'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1031"></span><span>               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="#local-6989586621679112589"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112590"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-1032"></span><span>
</span><span id="line-1033"></span><span class="hs-comment">-- | /O(n)/ 'replicateChar' @n@ @c@ is a 'Text' of length @n@ with @c@ the</span><span>
</span><span id="line-1034"></span><span class="hs-comment">-- value of every element. Subject to fusion.</span><span>
</span><span id="line-1035"></span><span class="annot"><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-type">replicateChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1036"></span><span id="replicateChar"><span class="annot"><span class="annottext">replicateChar :: Int64 -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-identifier hs-var hs-var">replicateChar</span></a></span></span><span> </span><span id="local-6989586621679112587"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112587"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112586"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112586"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Char -&gt; Stream Char
forall a. Integral a =&gt; a -&gt; Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#replicateCharI"><span class="hs-identifier hs-var">S.replicateCharI</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112587"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112586"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1037"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-pragma hs-type">replicateChar</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1038"></span><span>
</span><span id="line-1039"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1040"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT replicate/singleton -&gt; replicateChar&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112584"><span class="annot"><a href="#local-6989586621679112584"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112583"><span class="annot"><a href="#local-6989586621679112583"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1041"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#replicate"><span class="hs-pragma hs-type">replicate</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112584"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112583"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-pragma hs-type">replicateChar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112584"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112583"><span class="hs-pragma hs-type">c</span></a></span><span>
</span><span id="line-1042"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT replicate/unstream/singleton -&gt; replicateChar&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112582"><span class="annot"><a href="#local-6989586621679112582"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112581"><span class="annot"><a href="#local-6989586621679112581"><span class="hs-pragma hs-var">c</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1043"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#replicate"><span class="hs-pragma hs-type">replicate</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112582"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#singleton"><span class="hs-pragma hs-type">S.singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112581"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#replicateChar"><span class="hs-pragma hs-type">replicateChar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112582"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112581"><span class="hs-pragma hs-type">c</span></a></span><span>
</span><span id="line-1044"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1045"></span><span>
</span><span id="line-1046"></span><span class="hs-comment">-- | /O(n)/, where @n@ is the length of the result. The 'unfoldr'</span><span>
</span><span id="line-1047"></span><span class="hs-comment">-- function is analogous to the List 'L.unfoldr'. 'unfoldr' builds a</span><span>
</span><span id="line-1048"></span><span class="hs-comment">-- 'Text' from a seed value. The function takes the element and</span><span>
</span><span id="line-1049"></span><span class="hs-comment">-- returns 'Nothing' if it is done producing the 'Text', otherwise</span><span>
</span><span id="line-1050"></span><span class="hs-comment">-- 'Just' @(a,b)@.  In this case, @a@ is the next 'Char' in the</span><span>
</span><span id="line-1051"></span><span class="hs-comment">-- string, and @b@ is the seed value for further production.</span><span>
</span><span id="line-1052"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-1053"></span><span class="hs-comment">-- Performs replacement on invalid scalar values.</span><span>
</span><span id="line-1054"></span><span id="local-6989586621679113384"><span class="annot"><a href="Data.Text.Lazy.html#unfoldr"><span class="hs-identifier hs-type">unfoldr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679113384"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679113384"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113384"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span><span>
</span><span id="line-1055"></span><span id="unfoldr"><span class="annot"><span class="annottext">unfoldr :: forall a. (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Text
</span><a href="Data.Text.Lazy.html#unfoldr"><span class="hs-identifier hs-var hs-var">unfoldr</span></a></span></span><span> </span><span id="local-6989586621679112580"><span class="annot"><span class="annottext">a -&gt; Maybe (Char, a)
</span><a href="#local-6989586621679112580"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112579"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112579"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; Maybe (Char, a)) -&gt; a -&gt; Stream Char
forall a. (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#unfoldr"><span class="hs-identifier hs-var">S.unfoldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; Maybe (Char, a) -&gt; Maybe (Char, a)
forall a c b. (a -&gt; c) -&gt; Maybe (a, b) -&gt; Maybe (c, b)
</span><a href="Data.Text.Internal.html#firstf"><span class="hs-identifier hs-var">firstf</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, a) -&gt; Maybe (Char, a))
-&gt; (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Maybe (Char, a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe (Char, a)
</span><a href="#local-6989586621679112580"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112579"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1056"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unfoldr"><span class="hs-pragma hs-type">unfoldr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1057"></span><span>
</span><span id="line-1058"></span><span class="hs-comment">-- | /O(n)/ Like 'unfoldr', 'unfoldrN' builds a 'Text' from a seed</span><span>
</span><span id="line-1059"></span><span class="hs-comment">-- value. However, the length of the result should be limited by the</span><span>
</span><span id="line-1060"></span><span class="hs-comment">-- first argument to 'unfoldrN'. This function is more efficient than</span><span>
</span><span id="line-1061"></span><span class="hs-comment">-- 'unfoldr' when the maximum length of the result is known and</span><span>
</span><span id="line-1062"></span><span class="hs-comment">-- correct, otherwise its performance is similar to 'unfoldr'.</span><span>
</span><span id="line-1063"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-1064"></span><span class="hs-comment">-- Performs replacement on invalid scalar values.</span><span>
</span><span id="line-1065"></span><span id="local-6989586621679113378"><span class="annot"><a href="Data.Text.Lazy.html#unfoldrN"><span class="hs-identifier hs-type">unfoldrN</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679113378"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679113378"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113378"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span></span><span>
</span><span id="line-1066"></span><span id="unfoldrN"><span class="annot"><span class="annottext">unfoldrN :: forall a. Int64 -&gt; (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Text
</span><a href="Data.Text.Lazy.html#unfoldrN"><span class="hs-identifier hs-var hs-var">unfoldrN</span></a></span></span><span> </span><span id="local-6989586621679112577"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112577"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112576"><span class="annot"><span class="annottext">a -&gt; Maybe (Char, a)
</span><a href="#local-6989586621679112576"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112575"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112575"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Stream Char
forall a. Int64 -&gt; (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unfoldrN"><span class="hs-identifier hs-var">S.unfoldrN</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112577"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Char) -&gt; Maybe (Char, a) -&gt; Maybe (Char, a)
forall a c b. (a -&gt; c) -&gt; Maybe (a, b) -&gt; Maybe (c, b)
</span><a href="Data.Text.Internal.html#firstf"><span class="hs-identifier hs-var">firstf</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, a) -&gt; Maybe (Char, a))
-&gt; (a -&gt; Maybe (Char, a)) -&gt; a -&gt; Maybe (Char, a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe (Char, a)
</span><a href="#local-6989586621679112576"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679112575"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1067"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unfoldrN"><span class="hs-pragma hs-type">unfoldrN</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1068"></span><span>
</span><span id="line-1069"></span><span class="hs-comment">-- | /O(n)/ 'take' @n@, applied to a 'Text', returns the prefix of the</span><span>
</span><span id="line-1070"></span><span class="hs-comment">-- 'Text' of length @n@, or the 'Text' itself if @n@ is greater than</span><span>
</span><span id="line-1071"></span><span class="hs-comment">-- the length of the Text. Subject to fusion.</span><span>
</span><span id="line-1072"></span><span class="annot"><a href="Data.Text.Lazy.html#take"><span class="hs-identifier hs-type">take</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1073"></span><span id="take"><span class="annot"><span class="annottext">take :: Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#take"><span class="hs-identifier hs-var hs-var">take</span></a></span></span><span> </span><span id="local-6989586621679112573"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112573"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112573"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1074"></span><span class="annot"><a href="Data.Text.Lazy.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span id="local-6989586621679112572"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112572"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679112571"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112571"><span class="hs-identifier hs-var">t0</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112570"><span class="hs-identifier hs-var">take'</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112572"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112571"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1075"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1076"></span><span>    </span><span class="annot"><a href="#local-6989586621679112570"><span class="hs-identifier hs-type">take'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1077"></span><span>    </span><span id="local-6989586621679112570"><span class="annot"><span class="annottext">take' :: Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112570"><span class="hs-identifier hs-var hs-var">take'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1078"></span><span>    </span><span class="annot"><a href="#local-6989586621679112570"><span class="hs-identifier hs-var">take'</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1079"></span><span>    </span><span class="annot"><a href="#local-6989586621679112570"><span class="hs-identifier hs-var">take'</span></a></span><span> </span><span id="local-6989586621679112569"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112569"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112568"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112568"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112567"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112567"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1080"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112569"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112566"><span class="hs-identifier hs-var">len</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#take"><span class="hs-identifier hs-var">T.take</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112569"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112568"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1081"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112568"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112570"><span class="hs-identifier hs-var">take'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112569"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112566"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112567"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1082"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112566"><span class="annot"><span class="annottext">len :: Int64
</span><a href="#local-6989586621679112566"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112568"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1083"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#take"><span class="hs-pragma hs-type">take</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1084"></span><span>
</span><span id="line-1085"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1086"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT take -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112563"><span class="annot"><a href="#local-6989586621679112563"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112562"><span class="annot"><a href="#local-6989586621679112562"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1087"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#take"><span class="hs-pragma hs-type">take</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112563"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112562"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#take"><span class="hs-pragma hs-type">S.take</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112563"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112562"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-1088"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT take -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112560"><span class="annot"><a href="#local-6989586621679112560"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112559"><span class="annot"><a href="#local-6989586621679112559"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1089"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#take"><span class="hs-pragma hs-type">S.take</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112560"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112559"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#take"><span class="hs-pragma hs-type">take</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112560"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112559"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1090"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1091"></span><span>
</span><span id="line-1092"></span><span class="hs-comment">-- | /O(n)/ 'takeEnd' @n@ @t@ returns the suffix remaining after</span><span>
</span><span id="line-1093"></span><span class="hs-comment">-- taking @n@ characters from the end of @t@.</span><span>
</span><span id="line-1094"></span><span class="hs-comment">--</span><span>
</span><span id="line-1095"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1096"></span><span class="hs-comment">--</span><span>
</span><span id="line-1097"></span><span class="hs-comment">-- &gt; takeEnd 3 &quot;foobar&quot; == &quot;bar&quot;</span><span>
</span><span id="line-1098"></span><span class="hs-comment">--</span><span>
</span><span id="line-1099"></span><span class="hs-comment">-- @since 1.1.1.0</span><span>
</span><span id="line-1100"></span><span class="annot"><a href="Data.Text.Lazy.html#takeEnd"><span class="hs-identifier hs-type">takeEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1101"></span><span id="takeEnd"><span class="annot"><span class="annottext">takeEnd :: Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#takeEnd"><span class="hs-identifier hs-var hs-var">takeEnd</span></a></span></span><span> </span><span id="local-6989586621679112558"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112558"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112557"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112557"><span class="hs-identifier hs-var">t0</span></a></span></span><span>
</span><span id="line-1102"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112558"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-1103"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112556"><span class="hs-identifier hs-var">takeChunk</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112558"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; [Text]) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; [Text]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier hs-var">toChunks</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; Text -&gt; Text
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112557"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1104"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1105"></span><span>    </span><span class="annot"><a href="#local-6989586621679112556"><span class="hs-identifier hs-type">takeChunk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1106"></span><span>    </span><span id="local-6989586621679112556"><span class="annot"><span class="annottext">takeChunk :: Int64 -&gt; Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112556"><span class="hs-identifier hs-var hs-var">takeChunk</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679112554"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112554"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112554"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-1107"></span><span>    </span><span class="annot"><a href="#local-6989586621679112556"><span class="hs-identifier hs-var">takeChunk</span></a></span><span> </span><span id="local-6989586621679112553"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112553"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679112552"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112552"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112551"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112551"><span class="hs-identifier hs-var">t</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112550"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112550"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1108"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112553"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112549"><span class="hs-identifier hs-var">l</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#takeEnd"><span class="hs-identifier hs-var">T.takeEnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112553"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112551"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112552"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-1109"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112556"><span class="hs-identifier hs-var">takeChunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112553"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112549"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112551"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112552"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112550"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1110"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112549"><span class="annot"><span class="annottext">l :: Int64
</span><a href="#local-6989586621679112549"><span class="hs-identifier hs-var hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112551"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1111"></span><span>
</span><span id="line-1112"></span><span class="hs-comment">-- | /O(n)/ 'drop' @n@, applied to a 'Text', returns the suffix of the</span><span>
</span><span id="line-1113"></span><span class="hs-comment">-- 'Text' after the first @n@ characters, or the empty 'Text' if @n@</span><span>
</span><span id="line-1114"></span><span class="hs-comment">-- is greater than the length of the 'Text'. Subject to fusion.</span><span>
</span><span id="line-1115"></span><span class="annot"><a href="Data.Text.Lazy.html#drop"><span class="hs-identifier hs-type">drop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1116"></span><span id="drop"><span class="annot"><span class="annottext">drop :: Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#drop"><span class="hs-identifier hs-var hs-var">drop</span></a></span></span><span> </span><span id="local-6989586621679112547"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112547"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679112546"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112546"><span class="hs-identifier hs-var">t0</span></a></span></span><span>
</span><span id="line-1117"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112547"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112546"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1118"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112545"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112547"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112546"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1119"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1120"></span><span>    </span><span class="annot"><a href="#local-6989586621679112545"><span class="hs-identifier hs-type">drop'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1121"></span><span>    </span><span id="local-6989586621679112545"><span class="annot"><span class="annottext">drop' :: Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112545"><span class="hs-identifier hs-var hs-var">drop'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621679112544"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112544"><span class="hs-identifier hs-var">ts</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112544"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1122"></span><span>    </span><span class="annot"><a href="#local-6989586621679112545"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1123"></span><span>    </span><span class="annot"><a href="#local-6989586621679112545"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span id="local-6989586621679112543"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112543"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112542"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112542"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112541"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112541"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1124"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112543"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112540"><span class="hs-identifier hs-var">len</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#drop"><span class="hs-identifier hs-var">T.drop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112543"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112542"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112541"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1125"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112545"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112543"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112540"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112541"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1126"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112540"><span class="annot"><span class="annottext">len :: Int64
</span><a href="#local-6989586621679112540"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112542"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1127"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#drop"><span class="hs-pragma hs-type">drop</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1128"></span><span>
</span><span id="line-1129"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1130"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT drop -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112538"><span class="annot"><a href="#local-6989586621679112538"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112537"><span class="annot"><a href="#local-6989586621679112537"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1131"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#drop"><span class="hs-pragma hs-type">drop</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112538"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112537"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#drop"><span class="hs-pragma hs-type">S.drop</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112538"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112537"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-1132"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT drop -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112535"><span class="annot"><a href="#local-6989586621679112535"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112534"><span class="annot"><a href="#local-6989586621679112534"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1133"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#drop"><span class="hs-pragma hs-type">S.drop</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112535"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112534"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#drop"><span class="hs-pragma hs-type">drop</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112535"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112534"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1134"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1135"></span><span>
</span><span id="line-1136"></span><span class="hs-comment">-- | /O(n)/ 'dropEnd' @n@ @t@ returns the prefix remaining after</span><span>
</span><span id="line-1137"></span><span class="hs-comment">-- dropping @n@ characters from the end of @t@.</span><span>
</span><span id="line-1138"></span><span class="hs-comment">--</span><span>
</span><span id="line-1139"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1140"></span><span class="hs-comment">--</span><span>
</span><span id="line-1141"></span><span class="hs-comment">-- &gt; dropEnd 3 &quot;foobar&quot; == &quot;foo&quot;</span><span>
</span><span id="line-1142"></span><span class="hs-comment">--</span><span>
</span><span id="line-1143"></span><span class="hs-comment">-- @since 1.1.1.0</span><span>
</span><span id="line-1144"></span><span class="annot"><a href="Data.Text.Lazy.html#dropEnd"><span class="hs-identifier hs-type">dropEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1145"></span><span id="dropEnd"><span class="annot"><span class="annottext">dropEnd :: Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropEnd"><span class="hs-identifier hs-var hs-var">dropEnd</span></a></span></span><span> </span><span id="local-6989586621679112533"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112533"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112532"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112532"><span class="hs-identifier hs-var">t0</span></a></span></span><span>
</span><span id="line-1146"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112533"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112532"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1147"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112531"><span class="hs-identifier hs-var">dropChunk</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112533"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; [Text]) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; [Text]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier hs-var">toChunks</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; Text -&gt; Text
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112532"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1148"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1149"></span><span>    </span><span class="annot"><a href="#local-6989586621679112531"><span class="hs-identifier hs-type">dropChunk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1150"></span><span>    </span><span id="local-6989586621679112531"><span class="annot"><span class="annottext">dropChunk :: Int64 -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112531"><span class="hs-identifier hs-var hs-var">dropChunk</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-1151"></span><span>    </span><span class="annot"><a href="#local-6989586621679112531"><span class="hs-identifier hs-var">dropChunk</span></a></span><span> </span><span id="local-6989586621679112530"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112530"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112529"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112529"><span class="hs-identifier hs-var">t</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112528"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112528"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1152"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112530"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112527"><span class="hs-identifier hs-var">l</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112531"><span class="hs-identifier hs-var">dropChunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112530"><span class="hs-identifier hs-var">m</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112527"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112528"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1153"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier hs-var">fromChunks</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; ([Text] -&gt; [Text]) -&gt; [Text] -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; [Text] -&gt; Text
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1154"></span><span>                    </span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#dropEnd"><span class="hs-identifier hs-var">T.dropEnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112530"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112529"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112528"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1155"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112527"><span class="annot"><span class="annottext">l :: Int64
</span><a href="#local-6989586621679112527"><span class="hs-identifier hs-var hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112529"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1156"></span><span>
</span><span id="line-1157"></span><span class="hs-comment">-- | /O(n)/ 'dropWords' @n@ returns the suffix with @n@ 'Word16'</span><span>
</span><span id="line-1158"></span><span class="hs-comment">-- values dropped, or the empty 'Text' if @n@ is greater than the</span><span>
</span><span id="line-1159"></span><span class="hs-comment">-- number of 'Word16' values present.</span><span>
</span><span id="line-1160"></span><span class="annot"><a href="Data.Text.Lazy.html#dropWords"><span class="hs-identifier hs-type">dropWords</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1161"></span><span id="dropWords"><span class="annot"><span class="annottext">dropWords :: Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWords"><span class="hs-identifier hs-var hs-var">dropWords</span></a></span></span><span> </span><span id="local-6989586621679112524"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112524"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679112523"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112523"><span class="hs-identifier hs-var">t0</span></a></span></span><span>
</span><span id="line-1162"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112524"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112523"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1163"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112522"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112524"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112523"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1164"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1165"></span><span>    </span><span class="annot"><a href="#local-6989586621679112522"><span class="hs-identifier hs-type">drop'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1166"></span><span>    </span><span id="local-6989586621679112522"><span class="annot"><span class="annottext">drop' :: Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112522"><span class="hs-identifier hs-var hs-var">drop'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621679112521"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112521"><span class="hs-identifier hs-var">ts</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112521"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1167"></span><span>    </span><span class="annot"><a href="#local-6989586621679112522"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1168"></span><span>    </span><span class="annot"><a href="#local-6989586621679112522"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span id="local-6989586621679112520"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112520"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span id="local-6989586621679112519"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679112519"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679112518"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112518"><span class="hs-identifier hs-var">off</span></a></span></span><span> </span><span id="local-6989586621679112517"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112517"><span class="hs-identifier hs-var">len</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112516"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112516"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1169"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112520"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112515"><span class="hs-identifier hs-var">len'</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Int -&gt; Text
</span><a href="Data.Text.Internal.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679112519"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112518"><span class="hs-identifier hs-var">off</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112514"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112517"><span class="hs-identifier hs-var">len</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112514"><span class="hs-identifier hs-var">n'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112516"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1170"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="#local-6989586621679112522"><span class="hs-identifier hs-var">drop'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112520"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112515"><span class="hs-identifier hs-var">len'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112516"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1171"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112515"><span class="annot"><span class="annottext">len' :: Int64
</span><a href="#local-6989586621679112515"><span class="hs-identifier hs-var hs-var">len'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112517"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-1172"></span><span>              </span><span id="local-6989586621679112514"><span class="annot"><span class="annottext">n' :: Int
</span><a href="#local-6989586621679112514"><span class="hs-identifier hs-var hs-var">n'</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112520"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-1173"></span><span>
</span><span id="line-1174"></span><span class="hs-comment">-- | /O(n)/ 'takeWhile', applied to a predicate @p@ and a 'Text',</span><span>
</span><span id="line-1175"></span><span class="hs-comment">-- returns the longest prefix (possibly empty) of elements that</span><span>
</span><span id="line-1176"></span><span class="hs-comment">-- satisfy @p@.  Subject to fusion.</span><span>
</span><span id="line-1177"></span><span class="annot"><a href="Data.Text.Lazy.html#takeWhile"><span class="hs-identifier hs-type">takeWhile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1178"></span><span id="takeWhile"><span class="annot"><span class="annottext">takeWhile :: (Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#takeWhile"><span class="hs-identifier hs-var hs-var">takeWhile</span></a></span></span><span> </span><span id="local-6989586621679112513"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112513"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112512"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112512"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112511"><span class="hs-identifier hs-var">takeWhile'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112512"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1179"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112511"><span class="annot"><span class="annottext">takeWhile' :: Text -&gt; Text
</span><a href="#local-6989586621679112511"><span class="hs-identifier hs-var hs-var">takeWhile'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1180"></span><span>        </span><span class="annot"><a href="#local-6989586621679112511"><span class="hs-identifier hs-var">takeWhile'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112510"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112510"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112509"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112509"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1181"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Maybe Int
</span><a href="Data.Text.html#findIndex"><span class="hs-identifier hs-var">T.findIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Char -&gt; Bool) -&gt; Char -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112513"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112510"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1182"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679112507"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112507"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112507"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#take"><span class="hs-identifier hs-var">T.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112507"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112510"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1183"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1184"></span><span>            </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112510"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112511"><span class="hs-identifier hs-var">takeWhile'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112509"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1185"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#takeWhile"><span class="hs-pragma hs-type">takeWhile</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1186"></span><span>
</span><span id="line-1187"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1188"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT takeWhile -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112506"><span class="annot"><a href="#local-6989586621679112506"><span class="hs-pragma hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112505"><span class="annot"><a href="#local-6989586621679112505"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1189"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#takeWhile"><span class="hs-pragma hs-type">takeWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112506"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112505"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#takeWhile"><span class="hs-pragma hs-type">S.takeWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112506"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112505"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-1190"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT takeWhile -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112503"><span class="annot"><a href="#local-6989586621679112503"><span class="hs-pragma hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112502"><span class="annot"><a href="#local-6989586621679112502"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1191"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#takeWhile"><span class="hs-pragma hs-type">S.takeWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112503"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112502"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#takeWhile"><span class="hs-pragma hs-type">takeWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112503"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112502"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1192"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1193"></span><span class="hs-comment">-- | /O(n)/ 'takeWhileEnd', applied to a predicate @p@ and a 'Text',</span><span>
</span><span id="line-1194"></span><span class="hs-comment">-- returns the longest suffix (possibly empty) of elements that</span><span>
</span><span id="line-1195"></span><span class="hs-comment">-- satisfy @p@.</span><span>
</span><span id="line-1196"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1197"></span><span class="hs-comment">--</span><span>
</span><span id="line-1198"></span><span class="hs-comment">-- &gt; takeWhileEnd (=='o') &quot;foo&quot; == &quot;oo&quot;</span><span>
</span><span id="line-1199"></span><span class="hs-comment">--</span><span>
</span><span id="line-1200"></span><span class="hs-comment">-- @since 1.2.2.0</span><span>
</span><span id="line-1201"></span><span class="annot"><a href="Data.Text.Lazy.html#takeWhileEnd"><span class="hs-identifier hs-type">takeWhileEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1202"></span><span id="takeWhileEnd"><span class="annot"><span class="annottext">takeWhileEnd :: (Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#takeWhileEnd"><span class="hs-identifier hs-var hs-var">takeWhileEnd</span></a></span></span><span> </span><span id="local-6989586621679112501"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112501"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112500"><span class="hs-identifier hs-var">takeChunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; [Text]) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; [Text]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#toChunks"><span class="hs-identifier hs-var">toChunks</span></a></span><span>
</span><span id="line-1203"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112500"><span class="annot"><span class="annottext">takeChunk :: Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112500"><span class="hs-identifier hs-var hs-var">takeChunk</span></a></span></span><span> </span><span id="local-6989586621679112499"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112499"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112499"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-1204"></span><span>        </span><span class="annot"><a href="#local-6989586621679112500"><span class="hs-identifier hs-var">takeChunk</span></a></span><span> </span><span id="local-6989586621679112498"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112498"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112497"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112497"><span class="hs-identifier hs-var">t</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112496"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112496"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1205"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.Unsafe.html#lengthWord16"><span class="hs-identifier hs-var">T.lengthWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112495"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.Unsafe.html#lengthWord16"><span class="hs-identifier hs-var">T.lengthWord16</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112497"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1206"></span><span>                             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112495"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112498"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-1207"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; Text
</span><a href="#local-6989586621679112500"><span class="hs-identifier hs-var">takeChunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112495"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112498"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112496"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1208"></span><span>          </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112495"><span class="annot"><span class="annottext">t' :: Text
</span><a href="#local-6989586621679112495"><span class="hs-identifier hs-var hs-var">t'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.html#takeWhileEnd"><span class="hs-identifier hs-var">T.takeWhileEnd</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112501"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112497"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1209"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#takeWhileEnd"><span class="hs-pragma hs-type">takeWhileEnd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1210"></span><span>
</span><span id="line-1211"></span><span class="hs-comment">-- | /O(n)/ 'dropWhile' @p@ @t@ returns the suffix remaining after</span><span>
</span><span id="line-1212"></span><span class="hs-comment">-- 'takeWhile' @p@ @t@.  Subject to fusion.</span><span>
</span><span id="line-1213"></span><span class="annot"><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-identifier hs-type">dropWhile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1214"></span><span id="dropWhile"><span class="annot"><span class="annottext">dropWhile :: (Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-identifier hs-var hs-var">dropWhile</span></a></span></span><span> </span><span id="local-6989586621679112493"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112493"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112492"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112492"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112491"><span class="hs-identifier hs-var">dropWhile'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112492"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1215"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112491"><span class="annot"><span class="annottext">dropWhile' :: Text -&gt; Text
</span><a href="#local-6989586621679112491"><span class="hs-identifier hs-var hs-var">dropWhile'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1216"></span><span>        </span><span class="annot"><a href="#local-6989586621679112491"><span class="hs-identifier hs-var">dropWhile'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112490"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112490"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112489"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112489"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1217"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Maybe Int
</span><a href="Data.Text.html#findIndex"><span class="hs-identifier hs-var">T.findIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Char -&gt; Bool) -&gt; Char -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112493"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112490"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1218"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679112488"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112488"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; Text
</span><a href="Data.Text.html#drop"><span class="hs-identifier hs-var">T.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112488"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112490"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112489"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1219"></span><span>            </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112491"><span class="hs-identifier hs-var">dropWhile'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112489"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1220"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-pragma hs-type">dropWhile</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1221"></span><span>
</span><span id="line-1222"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1223"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT dropWhile -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112487"><span class="annot"><a href="#local-6989586621679112487"><span class="hs-pragma hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112486"><span class="annot"><a href="#local-6989586621679112486"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1224"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-pragma hs-type">dropWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112487"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112486"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#dropWhile"><span class="hs-pragma hs-type">S.dropWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112487"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112486"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span>
</span><span id="line-1225"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT dropWhile -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112484"><span class="annot"><a href="#local-6989586621679112484"><span class="hs-pragma hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112483"><span class="annot"><a href="#local-6989586621679112483"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1226"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-pragma hs-type">unstream</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#dropWhile"><span class="hs-pragma hs-type">S.dropWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112484"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112483"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-pragma hs-type">dropWhile</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112484"><span class="hs-pragma hs-type">p</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112483"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1227"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1228"></span><span>
</span><span id="line-1229"></span><span class="hs-comment">-- | /O(n)/ 'dropWhileEnd' @p@ @t@ returns the prefix remaining after</span><span>
</span><span id="line-1230"></span><span class="hs-comment">-- dropping characters that satisfy the predicate @p@ from the end of</span><span>
</span><span id="line-1231"></span><span class="hs-comment">-- @t@.</span><span>
</span><span id="line-1232"></span><span class="hs-comment">--</span><span>
</span><span id="line-1233"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1234"></span><span class="hs-comment">--</span><span>
</span><span id="line-1235"></span><span class="hs-comment">-- &gt; dropWhileEnd (=='.') &quot;foo...&quot; == &quot;foo&quot;</span><span>
</span><span id="line-1236"></span><span class="annot"><a href="Data.Text.Lazy.html#dropWhileEnd"><span class="hs-identifier hs-type">dropWhileEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1237"></span><span id="dropWhileEnd"><span class="annot"><span class="annottext">dropWhileEnd :: (Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWhileEnd"><span class="hs-identifier hs-var hs-var">dropWhileEnd</span></a></span></span><span> </span><span id="local-6989586621679112482"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112482"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112481"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-1238"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112481"><span class="annot"><span class="annottext">go :: Text -&gt; Text
</span><a href="#local-6989586621679112481"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1239"></span><span>        </span><span class="annot"><a href="#local-6989586621679112481"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112480"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112480"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.html#null"><span class="hs-identifier hs-var">T.null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112478"><span class="hs-identifier hs-var">t'</span></a></span><span>
</span><span id="line-1240"></span><span>                             </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1241"></span><span>                             </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112478"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1242"></span><span>            </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112478"><span class="annot"><span class="annottext">t' :: Text
</span><a href="#local-6989586621679112478"><span class="hs-identifier hs-var hs-var">t'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.html#dropWhileEnd"><span class="hs-identifier hs-var">T.dropWhileEnd</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112482"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112480"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1243"></span><span>        </span><span class="annot"><a href="#local-6989586621679112481"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112476"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112476"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112475"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112475"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112481"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112475"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1244"></span><span>                            </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="#local-6989586621679112481"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112476"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1245"></span><span>                            </span><span id="local-6989586621679112474"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112474"><span class="hs-identifier hs-var">ts'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112476"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112474"><span class="hs-identifier hs-var">ts'</span></a></span><span>
</span><span id="line-1246"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropWhileEnd"><span class="hs-pragma hs-type">dropWhileEnd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1247"></span><span>
</span><span id="line-1248"></span><span class="hs-comment">-- | /O(n)/ 'dropAround' @p@ @t@ returns the substring remaining after</span><span>
</span><span id="line-1249"></span><span class="hs-comment">-- dropping characters that satisfy the predicate @p@ from both the</span><span>
</span><span id="line-1250"></span><span class="hs-comment">-- beginning and end of @t@.</span><span>
</span><span id="line-1251"></span><span class="annot"><a href="Data.Text.Lazy.html#dropAround"><span class="hs-identifier hs-type">dropAround</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1252"></span><span id="dropAround"><span class="annot"><span class="annottext">dropAround :: (Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropAround"><span class="hs-identifier hs-var hs-var">dropAround</span></a></span></span><span> </span><span id="local-6989586621679112473"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112473"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112473"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; (Text -&gt; Text) -&gt; Text -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWhileEnd"><span class="hs-identifier hs-var">dropWhileEnd</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112473"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1253"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#dropAround"><span class="hs-pragma hs-type">dropAround</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1254"></span><span>
</span><span id="line-1255"></span><span class="hs-comment">-- | /O(n)/ Remove leading white space from a string.  Equivalent to:</span><span>
</span><span id="line-1256"></span><span class="hs-comment">--</span><span>
</span><span id="line-1257"></span><span class="hs-comment">-- &gt; dropWhile isSpace</span><span>
</span><span id="line-1258"></span><span class="annot"><a href="Data.Text.Lazy.html#stripStart"><span class="hs-identifier hs-type">stripStart</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1259"></span><span id="stripStart"><span class="annot"><span class="annottext">stripStart :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#stripStart"><span class="hs-identifier hs-var hs-var">stripStart</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span>
</span><span id="line-1260"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#stripStart"><span class="hs-pragma hs-type">stripStart</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1261"></span><span>
</span><span id="line-1262"></span><span class="hs-comment">-- | /O(n)/ Remove trailing white space from a string.  Equivalent to:</span><span>
</span><span id="line-1263"></span><span class="hs-comment">--</span><span>
</span><span id="line-1264"></span><span class="hs-comment">-- &gt; dropWhileEnd isSpace</span><span>
</span><span id="line-1265"></span><span class="annot"><a href="Data.Text.Lazy.html#stripEnd"><span class="hs-identifier hs-type">stripEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1266"></span><span id="stripEnd"><span class="annot"><span class="annottext">stripEnd :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#stripEnd"><span class="hs-identifier hs-var hs-var">stripEnd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWhileEnd"><span class="hs-identifier hs-var">dropWhileEnd</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span>
</span><span id="line-1267"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#stripEnd"><span class="hs-pragma hs-type">stripEnd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1268"></span><span>
</span><span id="line-1269"></span><span class="hs-comment">-- | /O(n)/ Remove leading and trailing white space from a string.</span><span>
</span><span id="line-1270"></span><span class="hs-comment">-- Equivalent to:</span><span>
</span><span id="line-1271"></span><span class="hs-comment">--</span><span>
</span><span id="line-1272"></span><span class="hs-comment">-- &gt; dropAround isSpace</span><span>
</span><span id="line-1273"></span><span class="annot"><a href="Data.Text.Lazy.html#strip"><span class="hs-identifier hs-type">strip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1274"></span><span id="strip"><span class="annot"><span class="annottext">strip :: Text -&gt; Text
</span><a href="Data.Text.Lazy.html#strip"><span class="hs-identifier hs-var hs-var">strip</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropAround"><span class="hs-identifier hs-var">dropAround</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span>
</span><span id="line-1275"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#strip"><span class="hs-pragma hs-type">strip</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1276"></span><span>
</span><span id="line-1277"></span><span class="hs-comment">-- | /O(n)/ 'splitAt' @n t@ returns a pair whose first element is a</span><span>
</span><span id="line-1278"></span><span class="hs-comment">-- prefix of @t@ of length @n@, and whose second is the remainder of</span><span>
</span><span id="line-1279"></span><span class="hs-comment">-- the string. It is equivalent to @('take' n t, 'drop' n t)@.</span><span>
</span><span id="line-1280"></span><span class="annot"><a href="Data.Text.Lazy.html#splitAt"><span class="hs-identifier hs-type">splitAt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1281"></span><span id="splitAt"><span class="annot"><span class="annottext">splitAt :: Int64 -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#splitAt"><span class="hs-identifier hs-var hs-var">splitAt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; (Text, Text)
</span><a href="#local-6989586621679112472"><span class="hs-identifier hs-var">loop</span></a></span><span>
</span><span id="line-1282"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1283"></span><span>    </span><span class="annot"><a href="#local-6989586621679112472"><span class="hs-identifier hs-type">loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1284"></span><span>    </span><span id="local-6989586621679112472"><span class="annot"><span class="annottext">loop :: Int64 -&gt; Text -&gt; (Text, Text)
</span><a href="#local-6989586621679112472"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1285"></span><span>    </span><span class="annot"><a href="#local-6989586621679112472"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span id="local-6989586621679112471"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112471"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112470"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112470"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112471"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112470"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1286"></span><span>    </span><span class="annot"><a href="#local-6989586621679112472"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span id="local-6989586621679112469"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112469"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112468"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112468"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112467"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112467"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1287"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112469"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112466"><span class="hs-identifier hs-var">len</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112465"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112465"><span class="hs-identifier hs-var">t'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112464"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112464"><span class="hs-identifier hs-var">t''</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.html#splitAt"><span class="hs-identifier hs-var">T.splitAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112469"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112468"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1288"></span><span>                       </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112465"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112464"><span class="hs-identifier hs-var">t''</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112467"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1289"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112462"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112462"><span class="hs-identifier hs-var">ts'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112461"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112461"><span class="hs-identifier hs-var">ts''</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; (Text, Text)
</span><a href="#local-6989586621679112472"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112469"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112466"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112467"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1290"></span><span>                       </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112468"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112462"><span class="hs-identifier hs-var">ts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112461"><span class="hs-identifier hs-var">ts''</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1291"></span><span>         </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112466"><span class="annot"><span class="annottext">len :: Int64
</span><a href="#local-6989586621679112466"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112468"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1292"></span><span>
</span><span id="line-1293"></span><span class="hs-comment">-- | /O(n)/ 'splitAtWord' @n t@ returns a strict pair whose first</span><span>
</span><span id="line-1294"></span><span class="hs-comment">-- element is a prefix of @t@ whose chunks contain @n@ 'Word16'</span><span>
</span><span id="line-1295"></span><span class="hs-comment">-- values, and whose second is the remainder of the string.</span><span>
</span><span id="line-1296"></span><span class="annot"><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-type">splitAtWord</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html#PairS"><span class="hs-identifier hs-type">PairS</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1297"></span><span id="splitAtWord"><span class="annot"><span class="annottext">splitAtWord :: Int64 -&gt; Text -&gt; PairS Text Text
</span><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-var hs-var">splitAtWord</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; PairS Text Text
forall a b. a -&gt; b -&gt; PairS a b
</span><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-var">:*:</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-1298"></span><span class="annot"><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-var">splitAtWord</span></a></span><span> </span><span id="local-6989586621679112458"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112458"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112457"><span class="annot"><span class="annottext">c :: Text
</span><a href="#local-6989586621679112457"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span id="local-6989586621679112456"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679112456"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span id="local-6989586621679112455"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112455"><span class="hs-identifier hs-var">off</span></a></span></span><span> </span><span id="local-6989586621679112454"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112454"><span class="hs-identifier hs-var">len</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112453"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112453"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1299"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112452"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112454"><span class="hs-identifier hs-var">len</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112451"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112451"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span id="local-6989586621679112450"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112450"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; PairS Text Text
</span><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-var">splitAtWord</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112458"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112454"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112453"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-1300"></span><span>                  </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112457"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112451"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; PairS Text Text
forall a b. a -&gt; b -&gt; PairS a b
</span><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-var">:*:</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112450"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1301"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Int -&gt; Text
</span><a href="Data.Text.Internal.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679112456"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112455"><span class="hs-identifier hs-var">off</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112452"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; PairS Text Text
forall a b. a -&gt; b -&gt; PairS a b
</span><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-var">:*:</span></a></span><span>
</span><span id="line-1302"></span><span>                  </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Int -&gt; Text
</span><a href="Data.Text.Internal.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679112456"><span class="hs-identifier hs-var">arr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112455"><span class="hs-identifier hs-var">off</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112452"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112454"><span class="hs-identifier hs-var">len</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112452"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112453"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-1303"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112452"><span class="annot"><span class="annottext">y :: Int
</span><a href="#local-6989586621679112452"><span class="hs-identifier hs-var hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var">int64ToInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112458"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1304"></span><span>
</span><span id="line-1305"></span><span class="hs-comment">-- | /O(n+m)/ Find the first instance of @needle@ (which must be</span><span>
</span><span id="line-1306"></span><span class="hs-comment">-- non-'null') in @haystack@.  The first element of the returned tuple</span><span>
</span><span id="line-1307"></span><span class="hs-comment">-- is the prefix of @haystack@ before @needle@ is matched.  The second</span><span>
</span><span id="line-1308"></span><span class="hs-comment">-- is the remainder of @haystack@, starting with the match.</span><span>
</span><span id="line-1309"></span><span class="hs-comment">--</span><span>
</span><span id="line-1310"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1311"></span><span class="hs-comment">--</span><span>
</span><span id="line-1312"></span><span class="hs-comment">-- &gt; breakOn &quot;::&quot; &quot;a::b::c&quot; ==&gt; (&quot;a&quot;, &quot;::b::c&quot;)</span><span>
</span><span id="line-1313"></span><span class="hs-comment">-- &gt; breakOn &quot;/&quot; &quot;foobar&quot;   ==&gt; (&quot;foobar&quot;, &quot;&quot;)</span><span>
</span><span id="line-1314"></span><span class="hs-comment">--</span><span>
</span><span id="line-1315"></span><span class="hs-comment">-- Laws:</span><span>
</span><span id="line-1316"></span><span class="hs-comment">--</span><span>
</span><span id="line-1317"></span><span class="hs-comment">-- &gt; append prefix match == haystack</span><span>
</span><span id="line-1318"></span><span class="hs-comment">-- &gt;   where (prefix, match) = breakOn needle haystack</span><span>
</span><span id="line-1319"></span><span class="hs-comment">--</span><span>
</span><span id="line-1320"></span><span class="hs-comment">-- If you need to break a string by a substring repeatedly (e.g. you</span><span>
</span><span id="line-1321"></span><span class="hs-comment">-- want to break on every instance of a substring), use 'breakOnAll'</span><span>
</span><span id="line-1322"></span><span class="hs-comment">-- instead, as it has lower startup overhead.</span><span>
</span><span id="line-1323"></span><span class="hs-comment">--</span><span>
</span><span id="line-1324"></span><span class="hs-comment">-- This function is strict in its first argument, and lazy in its</span><span>
</span><span id="line-1325"></span><span class="hs-comment">-- second.</span><span>
</span><span id="line-1326"></span><span class="hs-comment">--</span><span>
</span><span id="line-1327"></span><span class="hs-comment">-- In (unlikely) bad cases, this function's time complexity degrades</span><span>
</span><span id="line-1328"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-1329"></span><span class="annot"><a href="Data.Text.Lazy.html#breakOn"><span class="hs-identifier hs-type">breakOn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1330"></span><span id="breakOn"><span class="annot"><span class="annottext">breakOn :: Text -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#breakOn"><span class="hs-identifier hs-var hs-var">breakOn</span></a></span></span><span> </span><span id="local-6989586621679112449"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112449"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679112448"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112448"><span class="hs-identifier hs-var">src</span></a></span></span><span>
</span><span id="line-1331"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112449"><span class="hs-identifier hs-var">pat</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (Text, Text)
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;breakOn&quot;</span></span><span>
</span><span id="line-1332"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Int64]
</span><a href="Data.Text.Internal.Lazy.Search.html#indices"><span class="hs-identifier hs-var">indices</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112449"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112448"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1333"></span><span>                    </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112448"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1334"></span><span>                    </span><span class="hs-special">(</span><span id="local-6989586621679112447"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112447"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span class="annot"><span class="annottext">[Int64]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112446"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112446"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span id="local-6989586621679112445"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112445"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; PairS Text Text
</span><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-var">splitAtWord</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112447"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112448"><span class="hs-identifier hs-var">src</span></a></span><span>
</span><span id="line-1335"></span><span>                             </span><span class="hs-keyword">in</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112446"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112445"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1336"></span><span>
</span><span id="line-1337"></span><span class="hs-comment">-- | /O(n+m)/ Similar to 'breakOn', but searches from the end of the string.</span><span>
</span><span id="line-1338"></span><span class="hs-comment">--</span><span>
</span><span id="line-1339"></span><span class="hs-comment">-- The first element of the returned tuple is the prefix of @haystack@</span><span>
</span><span id="line-1340"></span><span class="hs-comment">-- up to and including the last match of @needle@.  The second is the</span><span>
</span><span id="line-1341"></span><span class="hs-comment">-- remainder of @haystack@, following the match.</span><span>
</span><span id="line-1342"></span><span class="hs-comment">--</span><span>
</span><span id="line-1343"></span><span class="hs-comment">-- &gt; breakOnEnd &quot;::&quot; &quot;a::b::c&quot; ==&gt; (&quot;a::b::&quot;, &quot;c&quot;)</span><span>
</span><span id="line-1344"></span><span class="annot"><a href="Data.Text.Lazy.html#breakOnEnd"><span class="hs-identifier hs-type">breakOnEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1345"></span><span id="breakOnEnd"><span class="annot"><span class="annottext">breakOnEnd :: Text -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#breakOnEnd"><span class="hs-identifier hs-var hs-var">breakOnEnd</span></a></span></span><span> </span><span id="local-6989586621679112444"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112444"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679112443"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112443"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112442"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112442"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112441"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112441"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#breakOn"><span class="hs-identifier hs-var">breakOn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112444"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112443"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1346"></span><span>                   </span><span class="hs-keyword">in</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112441"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112442"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1347"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#breakOnEnd"><span class="hs-pragma hs-type">breakOnEnd</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1348"></span><span>
</span><span id="line-1349"></span><span class="hs-comment">-- | /O(n+m)/ Find all non-overlapping instances of @needle@ in</span><span>
</span><span id="line-1350"></span><span class="hs-comment">-- @haystack@.  Each element of the returned list consists of a pair:</span><span>
</span><span id="line-1351"></span><span class="hs-comment">--</span><span>
</span><span id="line-1352"></span><span class="hs-comment">-- * The entire string prior to the /k/th match (i.e. the prefix)</span><span>
</span><span id="line-1353"></span><span class="hs-comment">--</span><span>
</span><span id="line-1354"></span><span class="hs-comment">-- * The /k/th match, followed by the remainder of the string</span><span>
</span><span id="line-1355"></span><span class="hs-comment">--</span><span>
</span><span id="line-1356"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1357"></span><span class="hs-comment">--</span><span>
</span><span id="line-1358"></span><span class="hs-comment">-- &gt; breakOnAll &quot;::&quot; &quot;&quot;</span><span>
</span><span id="line-1359"></span><span class="hs-comment">-- &gt; ==&gt; []</span><span>
</span><span id="line-1360"></span><span class="hs-comment">-- &gt; breakOnAll &quot;/&quot; &quot;a/b/c/&quot;</span><span>
</span><span id="line-1361"></span><span class="hs-comment">-- &gt; ==&gt; [(&quot;a&quot;, &quot;/b/c/&quot;), (&quot;a/b&quot;, &quot;/c/&quot;), (&quot;a/b/c&quot;, &quot;/&quot;)]</span><span>
</span><span id="line-1362"></span><span class="hs-comment">--</span><span>
</span><span id="line-1363"></span><span class="hs-comment">-- This function is strict in its first argument, and lazy in its</span><span>
</span><span id="line-1364"></span><span class="hs-comment">-- second.</span><span>
</span><span id="line-1365"></span><span class="hs-comment">--</span><span>
</span><span id="line-1366"></span><span class="hs-comment">-- In (unlikely) bad cases, this function's time complexity degrades</span><span>
</span><span id="line-1367"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-1368"></span><span class="hs-comment">--</span><span>
</span><span id="line-1369"></span><span class="hs-comment">-- The @needle@ parameter may not be empty.</span><span>
</span><span id="line-1370"></span><span class="annot"><a href="Data.Text.Lazy.html#breakOnAll"><span class="hs-identifier hs-type">breakOnAll</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>              </span><span class="hs-comment">-- ^ @needle@ to search for</span><span>
</span><span id="line-1371"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>              </span><span class="hs-comment">-- ^ @haystack@ in which to search</span><span>
</span><span id="line-1372"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1373"></span><span id="breakOnAll"><span class="annot"><span class="annottext">breakOnAll :: Text -&gt; Text -&gt; [(Text, Text)]
</span><a href="Data.Text.Lazy.html#breakOnAll"><span class="hs-identifier hs-var hs-var">breakOnAll</span></a></span></span><span> </span><span id="local-6989586621679112440"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112440"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679112439"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112439"><span class="hs-identifier hs-var">src</span></a></span></span><span>
</span><span id="line-1374"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112440"><span class="hs-identifier hs-var">pat</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [(Text, Text)]
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;breakOnAll&quot;</span></span><span>
</span><span id="line-1375"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text -&gt; [Int64] -&gt; [(Text, Text)]
</span><a href="#local-6989586621679112438"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112439"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Int64]
</span><a href="Data.Text.Internal.Lazy.Search.html#indices"><span class="hs-identifier hs-var">indices</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112440"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112439"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1376"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1377"></span><span>    </span><span id="local-6989586621679112438"><span class="annot"><span class="annottext">go :: Int64 -&gt; Text -&gt; Text -&gt; [Int64] -&gt; [(Text, Text)]
</span><a href="#local-6989586621679112438"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679112436"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112436"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112435"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112435"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112434"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112434"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112433"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112433"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112432"><span class="annot"><span class="annottext">[Int64]
</span><a href="#local-6989586621679112432"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112431"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112431"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span id="local-6989586621679112430"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112430"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; PairS Text Text
</span><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-var">splitAtWord</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112433"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112436"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112434"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1378"></span><span>                           </span><span id="local-6989586621679112429"><span class="annot"><span class="annottext">h' :: Text
</span><a href="#local-6989586621679112429"><span class="hs-identifier hs-var hs-var">h'</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#append"><span class="hs-identifier hs-var">append</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112435"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112431"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-1379"></span><span>                       </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112429"><span class="hs-identifier hs-var">h'</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112430"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Text, Text) -&gt; [(Text, Text)] -&gt; [(Text, Text)]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text -&gt; [Int64] -&gt; [(Text, Text)]
</span><a href="#local-6989586621679112438"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112433"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112429"><span class="hs-identifier hs-var">h'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112430"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">[Int64]
</span><a href="#local-6989586621679112432"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1380"></span><span>    </span><span class="annot"><a href="#local-6989586621679112438"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Int64]
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1381"></span><span>
</span><span id="line-1382"></span><span class="hs-comment">-- | /O(n)/ 'break' is like 'span', but the prefix returned is over</span><span>
</span><span id="line-1383"></span><span class="hs-comment">-- elements that fail the predicate @p@.</span><span>
</span><span id="line-1384"></span><span class="hs-comment">--</span><span>
</span><span id="line-1385"></span><span class="hs-comment">-- &gt;&gt;&gt; T.break (=='c') &quot;180cm&quot;</span><span>
</span><span id="line-1386"></span><span class="hs-comment">-- (&quot;180&quot;,&quot;cm&quot;)</span><span>
</span><span id="line-1387"></span><span class="annot"><a href="Data.Text.Lazy.html#break"><span class="hs-identifier hs-type">break</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1388"></span><span id="break"><span class="annot"><span class="annottext">break :: (Char -&gt; Bool) -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#break"><span class="hs-identifier hs-var hs-var">break</span></a></span></span><span> </span><span id="local-6989586621679112428"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112428"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112427"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112427"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; (Text, Text)
</span><a href="#local-6989586621679112426"><span class="hs-identifier hs-var">break'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112427"><span class="hs-identifier hs-var">t0</span></a></span><span>
</span><span id="line-1389"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112426"><span class="annot"><span class="annottext">break' :: Text -&gt; (Text, Text)
</span><a href="#local-6989586621679112426"><span class="hs-identifier hs-var hs-var">break'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1390"></span><span>        </span><span class="annot"><a href="#local-6989586621679112426"><span class="hs-identifier hs-var">break'</span></a></span><span> </span><span id="local-6989586621679112425"><span class="annot"><span class="annottext">c :: Text
</span><a href="#local-6989586621679112425"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112424"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112424"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112423"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112423"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1391"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Maybe Int
</span><a href="Data.Text.html#findIndex"><span class="hs-identifier hs-var">T.findIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112428"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112424"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1392"></span><span>            </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112422"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112422"><span class="hs-identifier hs-var">ts'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679112421"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112421"><span class="hs-identifier hs-var">ts''</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; (Text, Text)
</span><a href="#local-6989586621679112426"><span class="hs-identifier hs-var">break'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112423"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1393"></span><span>                            </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112424"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112422"><span class="hs-identifier hs-var">ts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112421"><span class="hs-identifier hs-var">ts''</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1394"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679112420"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112420"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112420"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112425"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1395"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112419"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112419"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112418"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112418"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.html#splitAt"><span class="hs-identifier hs-var">T.splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112420"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112424"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1396"></span><span>                                  </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112419"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112418"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112423"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1397"></span><span>
</span><span id="line-1398"></span><span class="hs-comment">-- | /O(n)/ 'span', applied to a predicate @p@ and text @t@, returns</span><span>
</span><span id="line-1399"></span><span class="hs-comment">-- a pair whose first element is the longest prefix (possibly empty)</span><span>
</span><span id="line-1400"></span><span class="hs-comment">-- of @t@ of elements that satisfy @p@, and whose second is the</span><span>
</span><span id="line-1401"></span><span class="hs-comment">-- remainder of the list.</span><span>
</span><span id="line-1402"></span><span class="hs-comment">--</span><span>
</span><span id="line-1403"></span><span class="hs-comment">-- &gt;&gt;&gt; T.span (=='0') &quot;000AB&quot;</span><span>
</span><span id="line-1404"></span><span class="hs-comment">-- (&quot;000&quot;,&quot;AB&quot;)</span><span>
</span><span id="line-1405"></span><span class="annot"><a href="Data.Text.Lazy.html#span"><span class="hs-identifier hs-type">span</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1406"></span><span id="span"><span class="annot"><span class="annottext">span :: (Char -&gt; Bool) -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#span"><span class="hs-identifier hs-var hs-var">span</span></a></span></span><span> </span><span id="local-6989586621679112417"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112417"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#break"><span class="hs-identifier hs-var">break</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Char -&gt; Bool) -&gt; Char -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112417"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1407"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#span"><span class="hs-pragma hs-type">span</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1408"></span><span>
</span><span id="line-1409"></span><span class="hs-comment">-- | The 'group' function takes a 'Text' and returns a list of 'Text's</span><span>
</span><span id="line-1410"></span><span class="hs-comment">-- such that the concatenation of the result is equal to the argument.</span><span>
</span><span id="line-1411"></span><span class="hs-comment">-- Moreover, each sublist in the result contains only equal elements.</span><span>
</span><span id="line-1412"></span><span class="hs-comment">-- For example,</span><span>
</span><span id="line-1413"></span><span class="hs-comment">--</span><span>
</span><span id="line-1414"></span><span class="hs-comment">-- &gt; group &quot;Mississippi&quot; = [&quot;M&quot;,&quot;i&quot;,&quot;ss&quot;,&quot;i&quot;,&quot;ss&quot;,&quot;i&quot;,&quot;pp&quot;,&quot;i&quot;]</span><span>
</span><span id="line-1415"></span><span class="hs-comment">--</span><span>
</span><span id="line-1416"></span><span class="hs-comment">-- It is a special case of 'groupBy', which allows the programmer to</span><span>
</span><span id="line-1417"></span><span class="hs-comment">-- supply their own equality test.</span><span>
</span><span id="line-1418"></span><span class="annot"><a href="Data.Text.Lazy.html#group"><span class="hs-identifier hs-type">group</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1419"></span><span id="group"><span class="annot"><span class="annottext">group :: Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#group"><span class="hs-identifier hs-var hs-var">group</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span>
</span><span id="line-1420"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#group"><span class="hs-pragma hs-type">group</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1421"></span><span>
</span><span id="line-1422"></span><span class="hs-comment">-- | The 'groupBy' function is the non-overloaded version of 'group'.</span><span>
</span><span id="line-1423"></span><span class="annot"><a href="Data.Text.Lazy.html#groupBy"><span class="hs-identifier hs-type">groupBy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1424"></span><span id="groupBy"><span class="annot"><span class="annottext">groupBy :: (Char -&gt; Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#groupBy"><span class="hs-identifier hs-var hs-var">groupBy</span></a></span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1425"></span><span class="annot"><a href="Data.Text.Lazy.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span id="local-6989586621679112416"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
</span><a href="#local-6989586621679112416"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112415"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112415"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112414"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112414"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#cons"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112413"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112412"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
</span><a href="#local-6989586621679112416"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112411"><span class="hs-identifier hs-var">zs</span></a></span><span>
</span><span id="line-1426"></span><span>                          </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112412"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112412"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112411"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112411"><span class="hs-identifier hs-var">zs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#span"><span class="hs-identifier hs-var">span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
</span><a href="#local-6989586621679112416"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112413"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112410"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1427"></span><span>                                </span><span id="local-6989586621679112413"><span class="annot"><span class="annottext">x :: Char
</span><a href="#local-6989586621679112413"><span class="hs-identifier hs-var hs-var">x</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Unsafe.html#unsafeHead"><span class="hs-identifier hs-var">T.unsafeHead</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112415"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1428"></span><span>                                </span><span id="local-6989586621679112410"><span class="annot"><span class="annottext">xs :: Text
</span><a href="#local-6989586621679112410"><span class="hs-identifier hs-var hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">T.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112415"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112414"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1429"></span><span>
</span><span id="line-1430"></span><span class="hs-comment">-- | /O(n)/ Return all initial segments of the given 'Text',</span><span>
</span><span id="line-1431"></span><span class="hs-comment">-- shortest first.</span><span>
</span><span id="line-1432"></span><span class="annot"><a href="Data.Text.Lazy.html#inits"><span class="hs-identifier hs-type">inits</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1433"></span><span id="inits"><span class="annot"><span class="annottext">inits :: Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#inits"><span class="hs-identifier hs-var hs-var">inits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; [Text]) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; [Text]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="#local-6989586621679112409"><span class="hs-identifier hs-var">inits'</span></a></span><span>
</span><span id="line-1434"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112409"><span class="annot"><span class="annottext">inits' :: Text -&gt; [Text]
</span><a href="#local-6989586621679112409"><span class="hs-identifier hs-var hs-var">inits'</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1435"></span><span>        </span><span class="annot"><a href="#local-6989586621679112409"><span class="hs-identifier hs-var">inits'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112408"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112408"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112407"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112407"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; [Text] -&gt; [Text]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679112406"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112406"><span class="hs-identifier hs-var">t'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112406"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#tail"><span class="hs-identifier hs-var">L.tail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.html#inits"><span class="hs-identifier hs-var">T.inits</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112408"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1436"></span><span>                           </span><span class="annot"><span class="annottext">[Text] -&gt; [Text] -&gt; [Text]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; [Text] -&gt; [Text]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112408"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="#local-6989586621679112409"><span class="hs-identifier hs-var">inits'</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112407"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1437"></span><span>
</span><span id="line-1438"></span><span class="hs-comment">-- | /O(n)/ Return all final segments of the given 'Text', longest</span><span>
</span><span id="line-1439"></span><span class="hs-comment">-- first.</span><span>
</span><span id="line-1440"></span><span class="annot"><a href="Data.Text.Lazy.html#tails"><span class="hs-identifier hs-type">tails</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1441"></span><span id="tails"><span class="annot"><span class="annottext">tails :: Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#tails"><span class="hs-identifier hs-var hs-var">tails</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1442"></span><span class="annot"><a href="Data.Text.Lazy.html#tails"><span class="hs-identifier hs-var">tails</span></a></span><span> </span><span id="local-6989586621679112403"><span class="annot"><span class="annottext">ts :: Text
</span><a href="#local-6989586621679112403"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112402"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112402"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112401"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112401"><span class="hs-identifier hs-var">ts'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1443"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112402"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112403"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#tails"><span class="hs-identifier hs-var">tails</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112401"><span class="hs-identifier hs-var">ts'</span></a></span><span>
</span><span id="line-1444"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112403"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#tails"><span class="hs-identifier hs-var">tails</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Unsafe.html#unsafeTail"><span class="hs-identifier hs-var">T.unsafeTail</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112402"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112401"><span class="hs-identifier hs-var">ts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1445"></span><span>
</span><span id="line-1446"></span><span class="hs-comment">-- $split</span><span>
</span><span id="line-1447"></span><span class="hs-comment">--</span><span>
</span><span id="line-1448"></span><span class="hs-comment">-- Splitting functions in this library do not perform character-wise</span><span>
</span><span id="line-1449"></span><span class="hs-comment">-- copies to create substrings; they just construct new 'Text's that</span><span>
</span><span id="line-1450"></span><span class="hs-comment">-- are slices of the original.</span><span>
</span><span id="line-1451"></span><span>
</span><span id="line-1452"></span><span class="hs-comment">-- | /O(m+n)/ Break a 'Text' into pieces separated by the first 'Text'</span><span>
</span><span id="line-1453"></span><span class="hs-comment">-- argument (which cannot be an empty string), consuming the</span><span>
</span><span id="line-1454"></span><span class="hs-comment">-- delimiter. An empty delimiter is invalid, and will cause an error</span><span>
</span><span id="line-1455"></span><span class="hs-comment">-- to be raised.</span><span>
</span><span id="line-1456"></span><span class="hs-comment">--</span><span>
</span><span id="line-1457"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1458"></span><span class="hs-comment">--</span><span>
</span><span id="line-1459"></span><span class="hs-comment">-- &gt; splitOn &quot;\r\n&quot; &quot;a\r\nb\r\nd\r\ne&quot; == [&quot;a&quot;,&quot;b&quot;,&quot;d&quot;,&quot;e&quot;]</span><span>
</span><span id="line-1460"></span><span class="hs-comment">-- &gt; splitOn &quot;aaa&quot;  &quot;aaaXaaaXaaaXaaa&quot;  == [&quot;&quot;,&quot;X&quot;,&quot;X&quot;,&quot;X&quot;,&quot;&quot;]</span><span>
</span><span id="line-1461"></span><span class="hs-comment">-- &gt; splitOn &quot;x&quot;    &quot;x&quot;                == [&quot;&quot;,&quot;&quot;]</span><span>
</span><span id="line-1462"></span><span class="hs-comment">--</span><span>
</span><span id="line-1463"></span><span class="hs-comment">-- and</span><span>
</span><span id="line-1464"></span><span class="hs-comment">--</span><span>
</span><span id="line-1465"></span><span class="hs-comment">-- &gt; intercalate s . splitOn s         == id</span><span>
</span><span id="line-1466"></span><span class="hs-comment">-- &gt; splitOn (singleton c)             == split (==c)</span><span>
</span><span id="line-1467"></span><span class="hs-comment">--</span><span>
</span><span id="line-1468"></span><span class="hs-comment">-- (Note: the string @s@ to split on above cannot be empty.)</span><span>
</span><span id="line-1469"></span><span class="hs-comment">--</span><span>
</span><span id="line-1470"></span><span class="hs-comment">-- This function is strict in its first argument, and lazy in its</span><span>
</span><span id="line-1471"></span><span class="hs-comment">-- second.</span><span>
</span><span id="line-1472"></span><span class="hs-comment">--</span><span>
</span><span id="line-1473"></span><span class="hs-comment">-- In (unlikely) bad cases, this function's time complexity degrades</span><span>
</span><span id="line-1474"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-1475"></span><span class="annot"><a href="Data.Text.Lazy.html#splitOn"><span class="hs-identifier hs-type">splitOn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1476"></span><span>        </span><span class="hs-comment">-- ^ String to split on. If this string is empty, an error</span><span>
</span><span id="line-1477"></span><span>        </span><span class="hs-comment">-- will occur.</span><span>
</span><span id="line-1478"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1479"></span><span>        </span><span class="hs-comment">-- ^ Input text.</span><span>
</span><span id="line-1480"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1481"></span><span id="splitOn"><span class="annot"><span class="annottext">splitOn :: Text -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#splitOn"><span class="hs-identifier hs-var hs-var">splitOn</span></a></span></span><span> </span><span id="local-6989586621679112400"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112400"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679112399"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112399"><span class="hs-identifier hs-var">src</span></a></span></span><span>
</span><span id="line-1482"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112400"><span class="hs-identifier hs-var">pat</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Text]
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;splitOn&quot;</span></span><span>
</span><span id="line-1483"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isSingleton"><span class="hs-identifier hs-var">isSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112400"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#split"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Lazy.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112400"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112399"><span class="hs-identifier hs-var">src</span></a></span><span>
</span><span id="line-1484"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; [Int64] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112398"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Int64]
</span><a href="Data.Text.Internal.Lazy.Search.html#indices"><span class="hs-identifier hs-var">indices</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112400"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112399"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112399"><span class="hs-identifier hs-var">src</span></a></span><span>
</span><span id="line-1485"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1486"></span><span>    </span><span id="local-6989586621679112398"><span class="annot"><span class="annottext">go :: Int64 -&gt; [Int64] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112398"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span>  </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span id="local-6989586621679112397"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112397"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112397"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1487"></span><span>    </span><span class="annot"><a href="#local-6989586621679112398"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679112396"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112396"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112395"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112395"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112394"><span class="annot"><span class="annottext">[Int64]
</span><a href="#local-6989586621679112394"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112393"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112393"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679112392"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112392"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Types.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span id="local-6989586621679112391"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112391"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; PairS Text Text
</span><a href="Data.Text.Lazy.html#splitAtWord"><span class="hs-identifier hs-var">splitAtWord</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112395"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112396"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112393"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-1488"></span><span>                      </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112392"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; [Int64] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112398"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112395"><span class="hs-identifier hs-var">x</span></a></span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112390"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Int64]
</span><a href="#local-6989586621679112394"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#dropWords"><span class="hs-identifier hs-var">dropWords</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112390"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112391"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1489"></span><span>    </span><span id="local-6989586621679112390"><span class="annot"><span class="annottext">l :: Int64
</span><a href="#local-6989586621679112390"><span class="hs-identifier hs-var hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int64 -&gt; Text -&gt; Int64) -&gt; Int64 -&gt; Text -&gt; Int64
forall a. (a -&gt; Text -&gt; a) -&gt; a -&gt; Text -&gt; a
</span><a href="Data.Text.Internal.Lazy.html#foldlChunks"><span class="hs-identifier hs-var">foldlChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679112389"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112389"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679112388"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112388"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112389"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int64 -&gt; Int64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var">intToInt64</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112388"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112400"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-1490"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#splitOn"><span class="hs-pragma hs-type">splitOn</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1491"></span><span>
</span><span id="line-1492"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1493"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT splitOn/singleton -&gt; split/==&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112387"><span class="annot"><a href="#local-6989586621679112387"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112386"><span class="annot"><a href="#local-6989586621679112386"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1494"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#splitOn"><span class="hs-pragma hs-type">splitOn</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112387"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679112386"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#split"><span class="hs-pragma hs-type">split</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-pragma hs-type">==</span></a></span><span class="annot"><a href="#local-6989586621679112387"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679112386"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1495"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1496"></span><span>
</span><span id="line-1497"></span><span class="hs-comment">-- | /O(n)/ Splits a 'Text' into components delimited by separators,</span><span>
</span><span id="line-1498"></span><span class="hs-comment">-- where the predicate returns True for a separator element.  The</span><span>
</span><span id="line-1499"></span><span class="hs-comment">-- resulting components do not contain the separators.  Two adjacent</span><span>
</span><span id="line-1500"></span><span class="hs-comment">-- separators result in an empty component in the output.  eg.</span><span>
</span><span id="line-1501"></span><span class="hs-comment">--</span><span>
</span><span id="line-1502"></span><span class="hs-comment">-- &gt; split (=='a') &quot;aabbaca&quot; == [&quot;&quot;,&quot;&quot;,&quot;bb&quot;,&quot;c&quot;,&quot;&quot;]</span><span>
</span><span id="line-1503"></span><span class="hs-comment">-- &gt; split (=='a') []        == [&quot;&quot;]</span><span>
</span><span id="line-1504"></span><span class="annot"><a href="Data.Text.Lazy.html#split"><span class="hs-identifier hs-type">split</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1505"></span><span id="split"><span class="annot"><span class="annottext">split :: (Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#split"><span class="hs-identifier hs-var hs-var">split</span></a></span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1506"></span><span class="annot"><a href="Data.Text.Lazy.html#split"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span id="local-6989586621679112385"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112385"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112384"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112384"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span id="local-6989586621679112383"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112383"><span class="hs-identifier hs-var">ts0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112382"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.html#split"><span class="hs-identifier hs-var">T.split</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112385"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112384"><span class="hs-identifier hs-var">t0</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112383"><span class="hs-identifier hs-var">ts0</span></a></span><span>
</span><span id="line-1507"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112382"><span class="annot"><span class="annottext">comb :: [Text] -&gt; [Text] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112382"><span class="hs-identifier hs-var hs-var">comb</span></a></span></span><span> </span><span id="local-6989586621679112380"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112380"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112379"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112379"><span class="hs-identifier hs-var">s</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#revChunks"><span class="hs-identifier hs-var">revChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112379"><span class="hs-identifier hs-var">s</span></a></span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112380"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1508"></span><span>        </span><span class="annot"><a href="#local-6989586621679112382"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span id="local-6989586621679112377"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112377"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112376"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112376"><span class="hs-identifier hs-var">s</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112375"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112375"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112374"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112374"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112382"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112376"><span class="hs-identifier hs-var">s</span></a></span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112377"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.html#split"><span class="hs-identifier hs-var">T.split</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112385"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112375"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112374"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1509"></span><span>        </span><span class="annot"><a href="#local-6989586621679112382"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span id="local-6989586621679112373"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112373"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112372"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112372"><span class="hs-identifier hs-var">s</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112371"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112371"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112370"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112370"><span class="hs-identifier hs-var">ts</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#revChunks"><span class="hs-identifier hs-var">revChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112372"><span class="hs-identifier hs-var">s</span></a></span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112373"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text] -&gt; Text -&gt; [Text]
</span><a href="#local-6989586621679112382"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112371"><span class="hs-identifier hs-var">ss</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112370"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-1510"></span><span>        </span><span class="annot"><a href="#local-6989586621679112382"><span class="hs-identifier hs-var">comb</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [Text]
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#impossibleError"><span class="hs-identifier hs-var">impossibleError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;split&quot;</span></span><span>
</span><span id="line-1511"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#split"><span class="hs-pragma hs-type">split</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1512"></span><span>
</span><span id="line-1513"></span><span class="hs-comment">-- | /O(n)/ Splits a 'Text' into components of length @k@.  The last</span><span>
</span><span id="line-1514"></span><span class="hs-comment">-- element may be shorter than the other chunks, depending on the</span><span>
</span><span id="line-1515"></span><span class="hs-comment">-- length of the input. Examples:</span><span>
</span><span id="line-1516"></span><span class="hs-comment">--</span><span>
</span><span id="line-1517"></span><span class="hs-comment">-- &gt; chunksOf 3 &quot;foobarbaz&quot;   == [&quot;foo&quot;,&quot;bar&quot;,&quot;baz&quot;]</span><span>
</span><span id="line-1518"></span><span class="hs-comment">-- &gt; chunksOf 4 &quot;haskell.org&quot; == [&quot;hask&quot;,&quot;ell.&quot;,&quot;org&quot;]</span><span>
</span><span id="line-1519"></span><span class="annot"><a href="Data.Text.Lazy.html#chunksOf"><span class="hs-identifier hs-type">chunksOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1520"></span><span id="chunksOf"><span class="annot"><span class="annottext">chunksOf :: Int64 -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#chunksOf"><span class="hs-identifier hs-var hs-var">chunksOf</span></a></span></span><span> </span><span id="local-6989586621679112368"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112368"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="#local-6989586621679112367"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-1521"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1522"></span><span>    </span><span id="local-6989586621679112367"><span class="annot"><span class="annottext">go :: Text -&gt; [Text]
</span><a href="#local-6989586621679112367"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112366"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112366"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112368"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112366"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1523"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621679112365"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112365"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112364"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112364"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112365"><span class="hs-identifier hs-var">a</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1524"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112365"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="#local-6989586621679112367"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112364"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1525"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#chunksOf"><span class="hs-pragma hs-type">chunksOf</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1526"></span><span>
</span><span id="line-1527"></span><span class="hs-comment">-- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at</span><span>
</span><span id="line-1528"></span><span class="hs-comment">-- newline 'Char's. The resulting strings do not contain newlines.</span><span>
</span><span id="line-1529"></span><span class="annot"><a href="Data.Text.Lazy.html#lines"><span class="hs-identifier hs-type">lines</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1530"></span><span id="lines"><span class="annot"><span class="annottext">lines :: Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#lines"><span class="hs-identifier hs-var hs-var">lines</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1531"></span><span class="annot"><a href="Data.Text.Lazy.html#lines"><span class="hs-identifier hs-var">lines</span></a></span><span> </span><span id="local-6989586621679112363"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112363"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112362"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112362"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112361"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112361"><span class="hs-identifier hs-var">t'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#break"><span class="hs-identifier hs-var">break</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112363"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1532"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112362"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112361"><span class="hs-identifier hs-var">t'</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1533"></span><span>                 </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#lines"><span class="hs-identifier hs-var">lines</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#tail"><span class="hs-identifier hs-var">tail</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112361"><span class="hs-identifier hs-var">t'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1534"></span><span>
</span><span id="line-1535"></span><span class="hs-comment">-- | /O(n)/ Breaks a 'Text' up into a list of words, delimited by 'Char's</span><span>
</span><span id="line-1536"></span><span class="hs-comment">-- representing white space.</span><span>
</span><span id="line-1537"></span><span class="annot"><a href="Data.Text.Lazy.html#words"><span class="hs-identifier hs-type">words</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1538"></span><span id="words"><span class="annot"><span class="annottext">words :: Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#words"><span class="hs-identifier hs-var hs-var">words</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Bool) -&gt; [Text] -&gt; [Text]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">L.filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Text -&gt; Bool) -&gt; Text -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; [Text]) -&gt; (Text -&gt; [Text]) -&gt; Text -&gt; [Text]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; [Text]
</span><a href="Data.Text.Lazy.html#split"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span>
</span><span id="line-1539"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#words"><span class="hs-pragma hs-type">words</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1540"></span><span>
</span><span id="line-1541"></span><span class="hs-comment">-- | /O(n)/ Joins lines, after appending a terminating newline to</span><span>
</span><span id="line-1542"></span><span class="hs-comment">-- each.</span><span>
</span><span id="line-1543"></span><span class="annot"><a href="Data.Text.Lazy.html#unlines"><span class="hs-identifier hs-type">unlines</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1544"></span><span id="unlines"><span class="annot"><span class="annottext">unlines :: [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#unlines"><span class="hs-identifier hs-var hs-var">unlines</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; ([Text] -&gt; [Text]) -&gt; [Text] -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; [Text] -&gt; [Text]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">L.map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Char -&gt; Text
</span><a href="Data.Text.Lazy.html#snoc"><span class="hs-operator hs-var">`snoc`</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span>
</span><span id="line-1545"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unlines"><span class="hs-pragma hs-type">unlines</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1546"></span><span>
</span><span id="line-1547"></span><span class="hs-comment">-- | /O(n)/ Joins words using single space characters.</span><span>
</span><span id="line-1548"></span><span class="annot"><a href="Data.Text.Lazy.html#unwords"><span class="hs-identifier hs-type">unwords</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1549"></span><span id="unwords"><span class="annot"><span class="annottext">unwords :: [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#unwords"><span class="hs-identifier hs-var hs-var">unwords</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Text
</span><a href="Data.Text.Lazy.html#singleton"><span class="hs-identifier hs-var">singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span>
</span><span id="line-1550"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#unwords"><span class="hs-pragma hs-type">unwords</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1551"></span><span>
</span><span id="line-1552"></span><span class="hs-comment">-- | /O(n)/ The 'isPrefixOf' function takes two 'Text's and returns</span><span>
</span><span id="line-1553"></span><span class="hs-comment">-- 'True' iff the first is a prefix of the second.  Subject to fusion.</span><span>
</span><span id="line-1554"></span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-type">isPrefixOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-1555"></span><span id="isPrefixOf"><span class="annot"><span class="annottext">isPrefixOf :: Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-var hs-var">isPrefixOf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-1556"></span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-var">isPrefixOf</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-1557"></span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-var">isPrefixOf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112360"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112360"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679112359"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112359"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112358"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112358"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679112357"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112357"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1558"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112356"><span class="hs-identifier hs-var">lx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112355"><span class="hs-identifier hs-var">ly</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112360"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112358"><span class="hs-identifier hs-var">y</span></a></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-var">isPrefixOf</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112359"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112357"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1559"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112356"><span class="hs-identifier hs-var">lx</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span>  </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112355"><span class="hs-identifier hs-var">ly</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112360"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112354"><span class="hs-identifier hs-var">yh</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-var">isPrefixOf</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112359"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112353"><span class="hs-identifier hs-var">yt</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112357"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1560"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112352"><span class="hs-identifier hs-var">xh</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112358"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-identifier hs-var">isPrefixOf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-var">Chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112351"><span class="hs-identifier hs-var">xt</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112359"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112357"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1561"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112352"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112352"><span class="hs-identifier hs-var">xh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112351"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112351"><span class="hs-identifier hs-var">xt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.html#splitAt"><span class="hs-identifier hs-var">T.splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112355"><span class="hs-identifier hs-var">ly</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112360"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1562"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679112354"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112354"><span class="hs-identifier hs-var">yh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112353"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112353"><span class="hs-identifier hs-var">yt</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.html#splitAt"><span class="hs-identifier hs-var">T.splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679112356"><span class="hs-identifier hs-var">lx</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112358"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-1563"></span><span>        </span><span id="local-6989586621679112356"><span class="annot"><span class="annottext">lx :: Int
</span><a href="#local-6989586621679112356"><span class="hs-identifier hs-var hs-var">lx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112360"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-1564"></span><span>        </span><span id="local-6989586621679112355"><span class="annot"><span class="annottext">ly :: Int
</span><a href="#local-6989586621679112355"><span class="hs-identifier hs-var hs-var">ly</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Int
</span><a href="Data.Text.html#length"><span class="hs-identifier hs-var">T.length</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112358"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-1565"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-pragma hs-type">isPrefixOf</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1566"></span><span>
</span><span id="line-1567"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1568"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT isPrefixOf -&gt; fused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112350"><span class="annot"><a href="#local-6989586621679112350"><span class="hs-pragma hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679112349"><span class="annot"><a href="#local-6989586621679112349"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1569"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-pragma hs-type">isPrefixOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112350"><span class="hs-pragma hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112349"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#isPrefixOf"><span class="hs-pragma hs-type">S.isPrefixOf</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112350"><span class="hs-pragma hs-type">s</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112349"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1570"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT isPrefixOf -&gt; unfused&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112347"><span class="annot"><a href="#local-6989586621679112347"><span class="hs-pragma hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679112346"><span class="annot"><a href="#local-6989586621679112346"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1571"></span><span>    </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#isPrefixOf"><span class="hs-pragma hs-type">S.isPrefixOf</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112347"><span class="hs-pragma hs-type">s</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112346"><span class="hs-pragma hs-type">t</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-pragma hs-type">isPrefixOf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112347"><span class="hs-pragma hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112346"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1572"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1573"></span><span>
</span><span id="line-1574"></span><span class="hs-comment">-- | /O(n)/ The 'isSuffixOf' function takes two 'Text's and returns</span><span>
</span><span id="line-1575"></span><span class="hs-comment">-- 'True' iff the first is a suffix of the second.</span><span>
</span><span id="line-1576"></span><span class="annot"><a href="Data.Text.Lazy.html#isSuffixOf"><span class="hs-identifier hs-type">isSuffixOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-1577"></span><span id="isSuffixOf"><span class="annot"><span class="annottext">isSuffixOf :: Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isSuffixOf"><span class="hs-identifier hs-var hs-var">isSuffixOf</span></a></span></span><span> </span><span id="local-6989586621679112345"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112345"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679112344"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112344"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112345"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isPrefixOf"><span class="hs-operator hs-var">`isPrefixOf`</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112344"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-1578"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isSuffixOf"><span class="hs-pragma hs-type">isSuffixOf</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1579"></span><span class="hs-comment">-- TODO: a better implementation</span><span>
</span><span id="line-1580"></span><span>
</span><span id="line-1581"></span><span class="hs-comment">-- | /O(n+m)/ The 'isInfixOf' function takes two 'Text's and returns</span><span>
</span><span id="line-1582"></span><span class="hs-comment">-- 'True' iff the first is contained, wholly and intact, anywhere</span><span>
</span><span id="line-1583"></span><span class="hs-comment">-- within the second.</span><span>
</span><span id="line-1584"></span><span class="hs-comment">--</span><span>
</span><span id="line-1585"></span><span class="hs-comment">-- This function is strict in its first argument, and lazy in its</span><span>
</span><span id="line-1586"></span><span class="hs-comment">-- second.</span><span>
</span><span id="line-1587"></span><span class="hs-comment">--</span><span>
</span><span id="line-1588"></span><span class="hs-comment">-- In (unlikely) bad cases, this function's time complexity degrades</span><span>
</span><span id="line-1589"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-1590"></span><span class="annot"><a href="Data.Text.Lazy.html#isInfixOf"><span class="hs-identifier hs-type">isInfixOf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-1591"></span><span id="isInfixOf"><span class="annot"><span class="annottext">isInfixOf :: Text -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isInfixOf"><span class="hs-identifier hs-var hs-var">isInfixOf</span></a></span></span><span> </span><span id="local-6989586621679112343"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112343"><span class="hs-identifier hs-var">needle</span></a></span></span><span> </span><span id="local-6989586621679112342"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112342"><span class="hs-identifier hs-var">haystack</span></a></span></span><span>
</span><span id="line-1592"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112343"><span class="hs-identifier hs-var">needle</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-1593"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#isSingleton"><span class="hs-identifier hs-var">isSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112343"><span class="hs-identifier hs-var">needle</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Stream Char -&gt; Bool
</span><a href="Data.Text.Internal.Fusion.Common.html#elem"><span class="hs-identifier hs-var">S.elem</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Char
</span><a href="Data.Text.Lazy.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112343"><span class="hs-identifier hs-var">needle</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Stream Char -&gt; Bool) -&gt; (Text -&gt; Stream Char) -&gt; Text -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">S.stream</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Bool) -&gt; Text -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112342"><span class="hs-identifier hs-var">haystack</span></a></span><span>
</span><span id="line-1594"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Text -&gt; Bool) -&gt; Text -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Int64] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">L.null</span></a></span><span> </span><span class="annot"><span class="annottext">([Int64] -&gt; Bool) -&gt; (Text -&gt; [Int64]) -&gt; Text -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Int64]
</span><a href="Data.Text.Internal.Lazy.Search.html#indices"><span class="hs-identifier hs-var">indices</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112343"><span class="hs-identifier hs-var">needle</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Bool) -&gt; Text -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112342"><span class="hs-identifier hs-var">haystack</span></a></span><span>
</span><span id="line-1595"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#isInfixOf"><span class="hs-pragma hs-type">isInfixOf</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1596"></span><span>
</span><span id="line-1597"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1598"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT isInfixOf/singleton -&gt; S.elem/S.stream&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112339"><span class="annot"><a href="#local-6989586621679112339"><span class="hs-pragma hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679112338"><span class="annot"><a href="#local-6989586621679112338"><span class="hs-pragma hs-var">h</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1599"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#isInfixOf"><span class="hs-pragma hs-type">isInfixOf</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112339"><span class="hs-pragma hs-type">n</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679112338"><span class="hs-pragma hs-type">h</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Internal.Fusion.Common.html#elem"><span class="hs-pragma hs-type">S.elem</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112339"><span class="hs-pragma hs-type">n</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-pragma hs-type">S.stream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112338"><span class="hs-pragma hs-type">h</span></a></span><span class="hs-pragma">)</span><span>
</span><span id="line-1600"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1601"></span><span>
</span><span id="line-1602"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-1603"></span><span class="hs-comment">-- * View patterns</span><span>
</span><span id="line-1604"></span><span>
</span><span id="line-1605"></span><span class="hs-comment">-- | /O(n)/ Return the suffix of the second string if its prefix</span><span>
</span><span id="line-1606"></span><span class="hs-comment">-- matches the entire first string.</span><span>
</span><span id="line-1607"></span><span class="hs-comment">--</span><span>
</span><span id="line-1608"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1609"></span><span class="hs-comment">--</span><span>
</span><span id="line-1610"></span><span class="hs-comment">-- &gt; stripPrefix &quot;foo&quot; &quot;foobar&quot; == Just &quot;bar&quot;</span><span>
</span><span id="line-1611"></span><span class="hs-comment">-- &gt; stripPrefix &quot;&quot;    &quot;baz&quot;    == Just &quot;baz&quot;</span><span>
</span><span id="line-1612"></span><span class="hs-comment">-- &gt; stripPrefix &quot;foo&quot; &quot;quux&quot;   == Nothing</span><span>
</span><span id="line-1613"></span><span class="hs-comment">--</span><span>
</span><span id="line-1614"></span><span class="hs-comment">-- This is particularly useful with the @ViewPatterns@ extension to</span><span>
</span><span id="line-1615"></span><span class="hs-comment">-- GHC, as follows:</span><span>
</span><span id="line-1616"></span><span class="hs-comment">--</span><span>
</span><span id="line-1617"></span><span class="hs-comment">-- &gt; {-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-1618"></span><span class="hs-comment">-- &gt; import Data.Text.Lazy as T</span><span>
</span><span id="line-1619"></span><span class="hs-comment">-- &gt;</span><span>
</span><span id="line-1620"></span><span class="hs-comment">-- &gt; fnordLength :: Text -&gt; Int</span><span>
</span><span id="line-1621"></span><span class="hs-comment">-- &gt; fnordLength (stripPrefix &quot;fnord&quot; -&gt; Just suf) = T.length suf</span><span>
</span><span id="line-1622"></span><span class="hs-comment">-- &gt; fnordLength _                                 = -1</span><span>
</span><span id="line-1623"></span><span class="annot"><a href="Data.Text.Lazy.html#stripPrefix"><span class="hs-identifier hs-type">stripPrefix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1624"></span><span id="stripPrefix"><span class="annot"><span class="annottext">stripPrefix :: Text -&gt; Text -&gt; Maybe Text
</span><a href="Data.Text.Lazy.html#stripPrefix"><span class="hs-identifier hs-var hs-var">stripPrefix</span></a></span></span><span> </span><span id="local-6989586621679112337"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112337"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112336"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112336"><span class="hs-identifier hs-var">t</span></a></span></span><span>
</span><span id="line-1625"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112337"><span class="hs-identifier hs-var">p</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Maybe Text
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112336"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1626"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Maybe (Text, Text, Text)
</span><a href="Data.Text.Lazy.html#commonPrefixes"><span class="hs-identifier hs-var">commonPrefixes</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112337"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112336"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1627"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679112335"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112335"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112334"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112334"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112335"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Maybe Text
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112334"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1628"></span><span>                    </span><span class="annot"><span class="annottext">Maybe (Text, Text, Text)
</span><span class="hs-identifier">_</span></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Text
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1629"></span><span>
</span><span id="line-1630"></span><span class="hs-comment">-- | /O(n)/ Find the longest non-empty common prefix of two strings</span><span>
</span><span id="line-1631"></span><span class="hs-comment">-- and return it, along with the suffixes of each string at which they</span><span>
</span><span id="line-1632"></span><span class="hs-comment">-- no longer match.</span><span>
</span><span id="line-1633"></span><span class="hs-comment">--</span><span>
</span><span id="line-1634"></span><span class="hs-comment">-- If the strings do not have a common prefix or either one is empty,</span><span>
</span><span id="line-1635"></span><span class="hs-comment">-- this function returns 'Nothing'.</span><span>
</span><span id="line-1636"></span><span class="hs-comment">--</span><span>
</span><span id="line-1637"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1638"></span><span class="hs-comment">--</span><span>
</span><span id="line-1639"></span><span class="hs-comment">-- &gt; commonPrefixes &quot;foobar&quot; &quot;fooquux&quot; == Just (&quot;foo&quot;,&quot;bar&quot;,&quot;quux&quot;)</span><span>
</span><span id="line-1640"></span><span class="hs-comment">-- &gt; commonPrefixes &quot;veeble&quot; &quot;fetzer&quot;  == Nothing</span><span>
</span><span id="line-1641"></span><span class="hs-comment">-- &gt; commonPrefixes &quot;&quot; &quot;baz&quot;           == Nothing</span><span>
</span><span id="line-1642"></span><span class="annot"><a href="Data.Text.Lazy.html#commonPrefixes"><span class="hs-identifier hs-type">commonPrefixes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1643"></span><span id="commonPrefixes"><span class="annot"><span class="annottext">commonPrefixes :: Text -&gt; Text -&gt; Maybe (Text, Text, Text)
</span><a href="Data.Text.Lazy.html#commonPrefixes"><span class="hs-identifier hs-var hs-var">commonPrefixes</span></a></span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Text, Text, Text)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1644"></span><span class="annot"><a href="Data.Text.Lazy.html#commonPrefixes"><span class="hs-identifier hs-var">commonPrefixes</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Text, Text, Text)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1645"></span><span class="annot"><a href="Data.Text.Lazy.html#commonPrefixes"><span class="hs-identifier hs-var">commonPrefixes</span></a></span><span> </span><span id="local-6989586621679112333"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112333"><span class="hs-identifier hs-var">a0</span></a></span></span><span> </span><span id="local-6989586621679112332"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112332"><span class="hs-identifier hs-var">b0</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text, Text, Text) -&gt; Maybe (Text, Text, Text)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Text] -&gt; (Text, Text, Text)
</span><a href="#local-6989586621679112331"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112333"><span class="hs-identifier hs-var">a0</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112332"><span class="hs-identifier hs-var">b0</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1646"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1647"></span><span>    </span><span id="local-6989586621679112331"><span class="annot"><span class="annottext">go :: Text -&gt; Text -&gt; [Text] -&gt; (Text, Text, Text)
</span><a href="#local-6989586621679112331"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679112330"><span class="annot"><span class="annottext">t0 :: Text
</span><a href="#local-6989586621679112330"><span class="hs-identifier hs-var">t0</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112329"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112329"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679112328"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112328"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112327"><span class="annot"><span class="annottext">t1 :: Text
</span><a href="#local-6989586621679112327"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Chunk"><span class="hs-identifier hs-type">Chunk</span></a></span><span> </span><span id="local-6989586621679112326"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112326"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679112325"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112325"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679112324"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112324"><span class="hs-identifier hs-var">ps</span></a></span></span><span>
</span><span id="line-1648"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Maybe (Text, Text, Text)
</span><a href="Data.Text.html#commonPrefixes"><span class="hs-identifier hs-var">T.commonPrefixes</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112329"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112326"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1649"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679112322"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112322"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112321"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112321"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679112320"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112320"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1650"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.html#null"><span class="hs-identifier hs-var">T.null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112321"><span class="hs-identifier hs-var">a</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Text] -&gt; (Text, Text, Text)
</span><a href="#local-6989586621679112331"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112328"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112320"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112325"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112322"><span class="hs-identifier hs-var">p</span></a></span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112324"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1651"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.html#null"><span class="hs-identifier hs-var">T.null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112320"><span class="hs-identifier hs-var">b</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Text] -&gt; (Text, Text, Text)
</span><a href="#local-6989586621679112331"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112321"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112328"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112325"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112322"><span class="hs-identifier hs-var">p</span></a></span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112324"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1652"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier hs-var">fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112322"><span class="hs-identifier hs-var">p</span></a></span><span class="annot"><span class="annottext">Text -&gt; [Text] -&gt; [Text]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112324"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112321"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112328"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112320"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112325"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1653"></span><span>            </span><span class="annot"><span class="annottext">Maybe (Text, Text, Text)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier hs-var">fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112324"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112330"><span class="hs-identifier hs-var">t0</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112327"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1654"></span><span>    </span><span class="annot"><a href="#local-6989586621679112331"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679112319"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112319"><span class="hs-identifier hs-var">t0</span></a></span></span><span> </span><span id="local-6989586621679112318"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112318"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621679112317"><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112317"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#fromChunks"><span class="hs-identifier hs-var">fromChunks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text] -&gt; [Text]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">L.reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679112317"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112319"><span class="hs-identifier hs-var">t0</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112318"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1655"></span><span>
</span><span id="line-1656"></span><span class="hs-comment">-- | /O(n)/ Return the prefix of the second string if its suffix</span><span>
</span><span id="line-1657"></span><span class="hs-comment">-- matches the entire first string.</span><span>
</span><span id="line-1658"></span><span class="hs-comment">--</span><span>
</span><span id="line-1659"></span><span class="hs-comment">-- Examples:</span><span>
</span><span id="line-1660"></span><span class="hs-comment">--</span><span>
</span><span id="line-1661"></span><span class="hs-comment">-- &gt; stripSuffix &quot;bar&quot; &quot;foobar&quot; == Just &quot;foo&quot;</span><span>
</span><span id="line-1662"></span><span class="hs-comment">-- &gt; stripSuffix &quot;&quot;    &quot;baz&quot;    == Just &quot;baz&quot;</span><span>
</span><span id="line-1663"></span><span class="hs-comment">-- &gt; stripSuffix &quot;foo&quot; &quot;quux&quot;   == Nothing</span><span>
</span><span id="line-1664"></span><span class="hs-comment">--</span><span>
</span><span id="line-1665"></span><span class="hs-comment">-- This is particularly useful with the @ViewPatterns@ extension to</span><span>
</span><span id="line-1666"></span><span class="hs-comment">-- GHC, as follows:</span><span>
</span><span id="line-1667"></span><span class="hs-comment">--</span><span>
</span><span id="line-1668"></span><span class="hs-comment">-- &gt; {-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-1669"></span><span class="hs-comment">-- &gt; import Data.Text.Lazy as T</span><span>
</span><span id="line-1670"></span><span class="hs-comment">-- &gt;</span><span>
</span><span id="line-1671"></span><span class="hs-comment">-- &gt; quuxLength :: Text -&gt; Int</span><span>
</span><span id="line-1672"></span><span class="hs-comment">-- &gt; quuxLength (stripSuffix &quot;quux&quot; -&gt; Just pre) = T.length pre</span><span>
</span><span id="line-1673"></span><span class="hs-comment">-- &gt; quuxLength _                                = -1</span><span>
</span><span id="line-1674"></span><span class="annot"><a href="Data.Text.Lazy.html#stripSuffix"><span class="hs-identifier hs-type">stripSuffix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1675"></span><span id="stripSuffix"><span class="annot"><span class="annottext">stripSuffix :: Text -&gt; Text -&gt; Maybe Text
</span><a href="Data.Text.Lazy.html#stripSuffix"><span class="hs-identifier hs-var hs-var">stripSuffix</span></a></span></span><span> </span><span id="local-6989586621679112316"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112316"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112315"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112315"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; Maybe Text -&gt; Maybe Text
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Maybe Text
</span><a href="Data.Text.Lazy.html#stripPrefix"><span class="hs-identifier hs-var">stripPrefix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112316"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text
</span><a href="Data.Text.Lazy.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112315"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1676"></span><span>
</span><span id="line-1677"></span><span class="hs-comment">-- | /O(n)/ 'filter', applied to a predicate and a 'Text',</span><span>
</span><span id="line-1678"></span><span class="hs-comment">-- returns a 'Text' containing those characters that satisfy the</span><span>
</span><span id="line-1679"></span><span class="hs-comment">-- predicate.</span><span>
</span><span id="line-1680"></span><span class="annot"><a href="Data.Text.Lazy.html#filter"><span class="hs-identifier hs-type">filter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1681"></span><span id="filter"><span class="annot"><span class="annottext">filter :: (Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#filter"><span class="hs-identifier hs-var hs-var">filter</span></a></span></span><span> </span><span id="local-6989586621679112314"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112314"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112313"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112313"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Stream Char -&gt; Stream Char
</span><a href="Data.Text.Internal.Fusion.Common.html#filter"><span class="hs-identifier hs-var">S.filter</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112314"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112313"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1682"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#filter"><span class="hs-pragma hs-type">filter</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1683"></span><span>
</span><span id="line-1684"></span><span class="hs-comment">-- | /O(n)/ The 'find' function takes a predicate and a 'Text', and</span><span>
</span><span id="line-1685"></span><span class="hs-comment">-- returns the first element in matching the predicate, or 'Nothing'</span><span>
</span><span id="line-1686"></span><span class="hs-comment">-- if there is no such element. Subject to fusion.</span><span>
</span><span id="line-1687"></span><span class="annot"><a href="Data.Text.Lazy.html#find"><span class="hs-identifier hs-type">find</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-1688"></span><span id="find"><span class="annot"><span class="annottext">find :: (Char -&gt; Bool) -&gt; Text -&gt; Maybe Char
</span><a href="Data.Text.Lazy.html#find"><span class="hs-identifier hs-var hs-var">find</span></a></span></span><span> </span><span id="local-6989586621679112311"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112311"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112310"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112310"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Stream Char -&gt; Maybe Char
</span><a href="Data.Text.Internal.Fusion.Common.html#findBy"><span class="hs-identifier hs-var">S.findBy</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112311"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112310"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1689"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#find"><span class="hs-pragma hs-type">find</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1690"></span><span>
</span><span id="line-1691"></span><span class="hs-comment">-- | /O(n)/ The 'elem' function takes a character and a 'Text', and</span><span>
</span><span id="line-1692"></span><span class="hs-comment">-- returns 'True' if the element is found in the given 'Text', or</span><span>
</span><span id="line-1693"></span><span class="hs-comment">-- 'False' otherwise.</span><span>
</span><span id="line-1694"></span><span class="annot"><a href="Data.Text.Lazy.html#elem"><span class="hs-identifier hs-type">elem</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-1695"></span><span id="elem"><span class="annot"><span class="annottext">elem :: Char -&gt; Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#elem"><span class="hs-identifier hs-var hs-var">elem</span></a></span></span><span> </span><span id="local-6989586621679112308"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112308"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112307"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112307"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Stream Char -&gt; Bool
</span><a href="Data.Text.Internal.Fusion.Common.html#any"><span class="hs-identifier hs-var">S.any</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112308"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112307"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1696"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#elem"><span class="hs-pragma hs-type">elem</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1697"></span><span>
</span><span id="line-1698"></span><span class="hs-comment">-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',</span><span>
</span><span id="line-1699"></span><span class="hs-comment">-- and returns the pair of 'Text's with elements which do and do not</span><span>
</span><span id="line-1700"></span><span class="hs-comment">-- satisfy the predicate, respectively; i.e.</span><span>
</span><span id="line-1701"></span><span class="hs-comment">--</span><span>
</span><span id="line-1702"></span><span class="hs-comment">-- &gt; partition p t == (filter p t, filter (not . p) t)</span><span>
</span><span id="line-1703"></span><span class="annot"><a href="Data.Text.Lazy.html#partition"><span class="hs-identifier hs-type">partition</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1704"></span><span id="partition"><span class="annot"><span class="annottext">partition :: (Char -&gt; Bool) -&gt; Text -&gt; (Text, Text)
</span><a href="Data.Text.Lazy.html#partition"><span class="hs-identifier hs-var hs-var">partition</span></a></span></span><span> </span><span id="local-6989586621679112306"><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112306"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679112305"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112305"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112306"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112305"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (Char -&gt; Bool) -&gt; Char -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="#local-6989586621679112306"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112305"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1705"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#partition"><span class="hs-pragma hs-type">partition</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1706"></span><span>
</span><span id="line-1707"></span><span class="hs-comment">-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.</span><span>
</span><span id="line-1708"></span><span class="hs-comment">-- Subject to fusion.</span><span>
</span><span id="line-1709"></span><span class="annot"><a href="Data.Text.Lazy.html#index"><span class="hs-identifier hs-type">index</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-1710"></span><span id="index"><span class="annot"><span class="annottext">index :: Text -&gt; Int64 -&gt; Char
</span><a href="Data.Text.Lazy.html#index"><span class="hs-identifier hs-var hs-var">index</span></a></span></span><span> </span><span id="local-6989586621679112304"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112304"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679112303"><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112303"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Int64 -&gt; Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#index"><span class="hs-identifier hs-var">S.index</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112304"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int64
</span><a href="#local-6989586621679112303"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-1711"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#index"><span class="hs-pragma hs-type">index</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1712"></span><span>
</span><span id="line-1713"></span><span class="hs-comment">-- | /O(n+m)/ The 'count' function returns the number of times the</span><span>
</span><span id="line-1714"></span><span class="hs-comment">-- query string appears in the given 'Text'. An empty query string is</span><span>
</span><span id="line-1715"></span><span class="hs-comment">-- invalid, and will cause an error to be raised.</span><span>
</span><span id="line-1716"></span><span class="hs-comment">--</span><span>
</span><span id="line-1717"></span><span class="hs-comment">-- In (unlikely) bad cases, this function's time complexity degrades</span><span>
</span><span id="line-1718"></span><span class="hs-comment">-- towards /O(n*m)/.</span><span>
</span><span id="line-1719"></span><span class="annot"><a href="Data.Text.Lazy.html#count"><span class="hs-identifier hs-type">count</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-1720"></span><span id="count"><span class="annot"><span class="annottext">count :: Text -&gt; Text -&gt; Int64
</span><a href="Data.Text.Lazy.html#count"><span class="hs-identifier hs-var hs-var">count</span></a></span></span><span> </span><span id="local-6989586621679112301"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112301"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621679112300"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112300"><span class="hs-identifier hs-var">src</span></a></span></span><span>
</span><span id="line-1721"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Text -&gt; Bool
</span><a href="Data.Text.Lazy.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112301"><span class="hs-identifier hs-var">pat</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int64
forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var">emptyError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;count&quot;</span></span><span>
</span><span id="line-1722"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; [Int64] -&gt; Int64
forall {t} {a}. Num t =&gt; t -&gt; [a] -&gt; t
</span><a href="#local-6989586621679112299"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; [Int64]
</span><a href="Data.Text.Internal.Lazy.Search.html#indices"><span class="hs-identifier hs-var">indices</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112301"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112300"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1723"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112299"><span class="annot"><span class="annottext">go :: t -&gt; [a] -&gt; t
</span><a href="#local-6989586621679112299"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679112295"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679112295"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679112295"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-1724"></span><span>        </span><span class="annot"><a href="#local-6989586621679112299"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679112294"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679112294"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679112293"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679112293"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t -&gt; [a] -&gt; t
</span><a href="#local-6989586621679112299"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621679112294"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">t -&gt; t -&gt; t
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">t
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679112293"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1725"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#count"><span class="hs-pragma hs-type">count</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1726"></span><span>
</span><span id="line-1727"></span><span class="hs-pragma">{-# RULES</span><span>
</span><span id="line-1728"></span><span class="annot"><span class="hs-pragma">&quot;LAZY TEXT count/singleton -&gt; countChar&quot;</span></span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">~</span><span class="hs-pragma">1</span><span class="hs-pragma">]</span><span> </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621679112292"><span class="annot"><a href="#local-6989586621679112292"><span class="hs-pragma hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112291"><span class="annot"><a href="#local-6989586621679112291"><span class="hs-pragma hs-var">t</span></a></span></span><span class="hs-pragma">.</span><span>
</span><span id="line-1729"></span><span>    </span><span class="annot"><a href="Data.Text.Lazy.html#count"><span class="hs-pragma hs-type">count</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><a href="Data.Text.Lazy.html#singleton"><span class="hs-pragma hs-type">singleton</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112292"><span class="hs-pragma hs-type">c</span></a></span><span class="hs-pragma">)</span><span> </span><span class="annot"><a href="#local-6989586621679112291"><span class="hs-pragma hs-type">t</span></a></span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#countChar"><span class="hs-pragma hs-type">countChar</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112292"><span class="hs-pragma hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679112291"><span class="hs-pragma hs-type">t</span></a></span><span>
</span><span id="line-1730"></span><span>  </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1731"></span><span>
</span><span id="line-1732"></span><span class="hs-comment">-- | /O(n)/ The 'countChar' function returns the number of times the</span><span>
</span><span id="line-1733"></span><span class="hs-comment">-- query element appears in the given 'Text'.  Subject to fusion.</span><span>
</span><span id="line-1734"></span><span class="annot"><a href="Data.Text.Lazy.html#countChar"><span class="hs-identifier hs-type">countChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-1735"></span><span id="countChar"><span class="annot"><span class="annottext">countChar :: Char -&gt; Text -&gt; Int64
</span><a href="Data.Text.Lazy.html#countChar"><span class="hs-identifier hs-var hs-var">countChar</span></a></span></span><span> </span><span id="local-6989586621679112289"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112289"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679112288"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112288"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Stream Char -&gt; Int64
</span><a href="Data.Text.Internal.Lazy.Fusion.html#countChar"><span class="hs-identifier hs-var">S.countChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112289"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112288"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1736"></span><span>
</span><span id="line-1737"></span><span class="hs-comment">-- | /O(n)/ 'zip' takes two 'Text's and returns a list of</span><span>
</span><span id="line-1738"></span><span class="hs-comment">-- corresponding pairs of bytes. If one input 'Text' is short,</span><span>
</span><span id="line-1739"></span><span class="hs-comment">-- excess elements of the longer 'Text' are discarded. This is</span><span>
</span><span id="line-1740"></span><span class="hs-comment">-- equivalent to a pair of 'unpack' operations.</span><span>
</span><span id="line-1741"></span><span class="annot"><a href="Data.Text.Lazy.html#zip"><span class="hs-identifier hs-type">zip</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1742"></span><span id="zip"><span class="annot"><span class="annottext">zip :: Text -&gt; Text -&gt; [(Char, Char)]
</span><a href="Data.Text.Lazy.html#zip"><span class="hs-identifier hs-var hs-var">zip</span></a></span></span><span> </span><span id="local-6989586621679112286"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112286"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679112285"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112285"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream (Char, Char) -&gt; [(Char, Char)]
forall a. Stream a -&gt; [a]
</span><a href="Data.Text.Internal.Fusion.Common.html#unstreamList"><span class="hs-identifier hs-var">S.unstreamList</span></a></span><span> </span><span class="annot"><span class="annottext">(Stream (Char, Char) -&gt; [(Char, Char)])
-&gt; Stream (Char, Char) -&gt; [(Char, Char)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; (Char, Char))
-&gt; Stream Char -&gt; Stream Char -&gt; Stream (Char, Char)
forall a b. (a -&gt; a -&gt; b) -&gt; Stream a -&gt; Stream a -&gt; Stream b
</span><a href="Data.Text.Internal.Fusion.Common.html#zipWith"><span class="hs-identifier hs-var">S.zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112286"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112285"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1743"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#zip"><span class="hs-pragma hs-type">zip</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1744"></span><span>
</span><span id="line-1745"></span><span class="hs-comment">-- | /O(n)/ 'zipWith' generalises 'zip' by zipping with the function</span><span>
</span><span id="line-1746"></span><span class="hs-comment">-- given as the first argument, instead of a tupling function.</span><span>
</span><span id="line-1747"></span><span class="hs-comment">-- Performs replacement on invalid scalar values.</span><span>
</span><span id="line-1748"></span><span class="annot"><a href="Data.Text.Lazy.html#zipWith"><span class="hs-identifier hs-type">zipWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1749"></span><span id="zipWith"><span class="annot"><span class="annottext">zipWith :: (Char -&gt; Char -&gt; Char) -&gt; Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Lazy.html#zipWith"><span class="hs-identifier hs-var hs-var">zipWith</span></a></span></span><span> </span><span id="local-6989586621679112283"><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112283"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679112282"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112282"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621679112281"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112281"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Stream Char -&gt; Text
</span><a href="Data.Text.Internal.Lazy.Fusion.html#unstream"><span class="hs-identifier hs-var">unstream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Char -&gt; Char) -&gt; Stream Char -&gt; Stream Char -&gt; Stream Char
forall a b. (a -&gt; a -&gt; b) -&gt; Stream a -&gt; Stream a -&gt; Stream b
</span><a href="Data.Text.Internal.Fusion.Common.html#zipWith"><span class="hs-identifier hs-var">S.zipWith</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112280"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112282"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Stream Char
</span><a href="Data.Text.Internal.Lazy.Fusion.html#stream"><span class="hs-identifier hs-var">stream</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679112281"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1750"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679112280"><span class="annot"><span class="annottext">g :: Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112280"><span class="hs-identifier hs-var hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679112279"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112279"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679112278"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112278"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char
</span><a href="Data.Text.Internal.html#safe"><span class="hs-keyword hs-var">safe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Char
</span><a href="#local-6989586621679112283"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112279"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679112278"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1751"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">[</span><span class="hs-pragma">0</span><span class="hs-pragma">]</span><span> </span><span class="annot"><a href="Data.Text.Lazy.html#zipWith"><span class="hs-pragma hs-type">zipWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1752"></span><span>
</span><span id="line-1753"></span><span class="annot"><a href="Data.Text.Lazy.html#revChunks"><span class="hs-identifier hs-type">revChunks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Data.Text.Internal.html#Text"><span class="hs-identifier hs-type">T.Text</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Internal.Lazy.html#Text"><span class="hs-identifier hs-type">Text</span></a></span><span>
</span><span id="line-1754"></span><span id="revChunks"><span class="annot"><span class="annottext">revChunks :: [Text] -&gt; Text
</span><a href="Data.Text.Lazy.html#revChunks"><span class="hs-identifier hs-var hs-var">revChunks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text) -&gt; Text -&gt; [Text] -&gt; Text
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">L.foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Text -&gt; Text -&gt; Text) -&gt; Text -&gt; Text -&gt; Text
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
</span><a href="Data.Text.Internal.Lazy.html#chunk"><span class="hs-identifier hs-var">chunk</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="Data.Text.Internal.Lazy.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-1755"></span><span>
</span><span id="line-1756"></span><span id="local-6989586621679113401"><span class="annot"><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-type">emptyError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679113401"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1757"></span><span id="emptyError"><span class="annot"><span class="annottext">emptyError :: forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#emptyError"><span class="hs-identifier hs-var hs-var">emptyError</span></a></span></span><span> </span><span id="local-6989586621679112274"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112274"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">P.error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Text.Lazy.&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112274"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: empty input&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1758"></span><span>
</span><span id="line-1759"></span><span id="local-6989586621679112273"><span class="annot"><a href="Data.Text.Lazy.html#impossibleError"><span class="hs-identifier hs-type">impossibleError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679112273"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1760"></span><span id="impossibleError"><span class="annot"><span class="annottext">impossibleError :: forall a. String -&gt; a
</span><a href="Data.Text.Lazy.html#impossibleError"><span class="hs-identifier hs-var hs-var">impossibleError</span></a></span></span><span> </span><span id="local-6989586621679112270"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112270"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">P.error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Data.Text.Lazy.&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679112270"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: impossible case&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1761"></span><span>
</span><span id="line-1762"></span><span class="annot"><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-type">intToInt64</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Exts.Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span>
</span><span id="line-1763"></span><span id="intToInt64"><span class="annot"><span class="annottext">intToInt64 :: Int -&gt; Int64
</span><a href="Data.Text.Lazy.html#intToInt64"><span class="hs-identifier hs-var hs-var">intToInt64</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int64
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span>
</span><span id="line-1764"></span><span>
</span><span id="line-1765"></span><span class="annot"><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-type">int64ToInt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Int.html#Int64"><span class="hs-identifier hs-type">Int64</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Exts.Int</span></a></span><span>
</span><span id="line-1766"></span><span id="int64ToInt"><span class="annot"><span class="annottext">int64ToInt :: Int64 -&gt; Int
</span><a href="Data.Text.Lazy.html#int64ToInt"><span class="hs-identifier hs-var hs-var">int64ToInt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span>
</span><span id="line-1767"></span></pre></body></html>